Write a program that includes two functions

  

Program #4

Write a program that includes two functions. The First (named isPerfect) receives no parameters and does not return any parameters. It simply calculates and prints all the perfect numbers between 1 and 10000. A perfect number is a number whose sum of its divisors (not including the number itself) add up to the number

Determine through processing and print each perfect number and its divisors from 1 to 10000 (there are only 4). Pause the screen and clear the screen between outputs. The output for each perfect number should be like the following example.

6 is perfect. Its divisors are 

1, 2, 3

The second function (named isPrime) that receives an integer as a parameter and returns a boolean that indicates whether the number is prime or not. Allow the user to enter a number between 2 and 10000 and printout whether it is prime or not. Example of prompts and output

Please enter an integer and I will tell you if it is prime: 19

19 is prime

Would you like to do another (y/n)? y

…clear screen

Please enter an integer and I will tell you if it is prime: 21

21 is not prime

Would you like to do another (y/n)? n

…end the program

Clear the screen between runs. Do not rerun the perfect code, just the prime.

Make sure you use function prototypes and no globals. Make sure your output is like the above.

Check for invalid input for the prime. If an invalid number is entered, display an error message and then go to the prompt that asks whether he wants to do another.

Name the program numbers.cpp

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more