Create a program that takes in a positive integer number

Assignment Help C/C++ Programming
Reference no: EM131071839

Create a program that takes in a positive integer number from the user and searches for the number with the highest sum of divisors from the 1 to the user imputed number. The program then has to output the number in this range with the highest sum of divisors and the sum of its divisors in message like this: "Number 8 has a maximum sum of divisors 15".

So far I've created a while loop that prevents the user from proceeding if they don't enter a positive integer but I haven't been able to program the part that selects the number in the range with the highest sum of divisors and the sum of its divisors and the project is due tomorrow night.

This is what I have so far:

#include <iostream>
Using namespace std;
Int main ()
{
Int x;
Cout<< "enter a positive integer";
Cin>>x;
While (x<0||x>20000)
{
Cout<<"positive integers only please";
Cin>>x;
}

Reference no: EM131071839

Questions Cloud

How can you define a dual relationship to a layperson : Search for your state's legal statutes in the code of professional standards regarding professional boundaries. What types of activities would the APA Ethics Code consider to be professional boundaries violations? How do your local statutes relate..
Estimate the cost today of an options strategy : Detail the hedging strategy with options - Estimate the cost today of an options strategy that will eliminate exchange rate risk.
Calculate the net present value ignoring additional benefits : Calculate the net present value, ignoring the additional benefits described by Rick. Should the tow truck be purchased? Calculate the net present value, incorporating the additional benefits suggested by Rick. Should the tow truck be purchased?
Are jung beliefs similar to those in christianity : You are to compare Jung's' viewpoint of religion with some of the basic tenets of the Christian faith. Are Jung's beliefs similar to those in Christianity? Why or why not? You need to have at least three academic references outside of your text ..
Create a program that takes in a positive integer number : Create a program that takes in a positive integer number from the user and searches for the number with the highest sum of divisors from the 1 to the user imputed number
Create a map and store social security numbers by names : Create a map and store social security numbers by names. Iterate through your container and retrieve all names. Seach for an individual name and print the ssn
Implement a hotelroom class : Implement a HotelRoom class, with private data members: the room number, room capacity (representing the maximum number of people the room can accommodate), the occupancy status (0 or the number of occupants in the room), the daily room rate
Identify two potential trading partners with justification : Analyze in a minimum of 1,050 words, using this case study as the basis, the impact of currency manipulation on cross-border trade and investment activities.
Write your maximum error-free channel capacity function : For your function what is the instantaneous rate of change in maximum error-free channel capacity with respect to SNR, for SNR=30? What is the equation of the tangent line to the graph of C(SNR), when SNR=30?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The first will be a structure called point

Create two structures. The first will be a structure called Point and will have as its data members an x and y coordinate. The second will be called Line and will have two Point structures as its data members.

  Write a c program that displays a table showing the price

write a c program that displays a table showing the price of silver and gold. the table will have three columns. the

  What more efficient way to write this function for matrix

What's a more efficient way to write this function for a matrix? This one has to go through all the numbers, but that would take too long. r_num is row and c_num is column

  Write a function named caesardecipher

Write a function named caesarDecipher that accepts a key value (the Caesar shift value) as its first command-line parameter, and a string (the ciphertext) for its second parameter. Your caesarDecipher function should look like this:

  Sort an array of elements using the quick sort algorithm

Sort an array of 10,000 elements using the quick sort algorithm as follows: sort the array using pivot as the middle element of the array

  Conditional statementsquestion 1 write a program that

conditional statementsquestion 1 write a program that computes the cost of a long distance call. the cost of the call

  Program reads the contents of employees

Design a program that reads the contents of the employees.dat file and prints all the data within it. Format the report as designated in the Printer Spacing Chart below.

  Destroy sauron''s ring by throwing it into the volcano

In order to destroy Sauron's ring by throwing it into the volcano Mt. Doom in the heart of Mordor, the hobbits have traveled a long way from their home in the Shire.

  Use the top-down modular approach to design program

Use the top-down modular approach and pseudocode to design a suitable program to solve it. Where appropriate, use defensive programming techniques.

  Write c program to read one ip address

Write a C or C++ program which Read one IP address at a time from Dec_IPAddresses.txt and convert it into Hex. Store converted values stored in another file (e.g. HEX_IPAddresses.txt).

  Use at least two programmer defined functions

C++ Using an input file similar to the one below, write a program to determine the highest concentration recorded and the number of days the photochemical oxidant concentration exceeded the standard; display number of days and percentage (based on th..

  Show how this priority queue is affected by adding string

To tell if one element in ZooGraph has relation X to another element, you look for a path between them. Show whether the following statements are true, using the picture or adjacency matrix.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd