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

  Write a script that creates a craps game

Write a script that creates a craps game and meets the following requirements. Name the script craps.sh The script will get 2 random numbers between 1-6.

  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

  Value referenced by the pointer.

Add 10 to the value referenced by pointer switch.Add 4 to the address stored in pointer switch.Subtract 5 from the value referenced by the pointer.

  Create a class called bank account

Create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance. The BankAccount class should have two constructors, as follows

  Write a small program to simulate a raffle

Write a small program to simulate a raffle (a gambling game) for a group with 100 members. You can simply identify each member with a no-duplicated ID numbers from 01 to 100. A number ticket with a positive 4-digits integer number will be randomly cr..

  Write a program which has a base process which communicates

write a program which has a base process which communicates with child processes acting as bombers that it

  Print out the sum of all numbers, the average

Write a program that reads in a list of integer numbers and print out the sum of all numbers, the average, the lowest and the highest value entered. The first input number indicates how many numbers the program is attempting to read

  Write a program that prints minimax and maximin of a matrix

The optimal strategies are possible when these two values are equal. Write a program that prints the minimax and the maximin of a given matrix.

  Write a program that grades an online quiz

write a program that grades an online quiz. The program asks the student to enter his/her answer to 10 multiple-choice questions. The program stores the student's responses in an array and then compares those responses to the correct answers to de..

  Calculate and display the area of the rectangle

Calculate and display the area of the rectangle and the total price of the tile. Add comments in code section. Code this program in java programming.

  Coinflip to prompt for and input a number

Write a program and name it CoinFlip to prompt for and input a number of times to flip a coin, then to output the number of "heads" and the number of "tails" that were flipped.

  Write a c program that reads a as 100 decimal

Write a C program that reads A as 100 decimal (0x64) and calculate B so that A xor B = 120 (how do you show A B in C program?).

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