08 Jun Write an entire C++ program that reads a positive integer
Question
Write an entire C++ program that reads a positive integer entered by an interactive user and then prints out
all the positive divisors of that integer in a column and in decreasing order. The program should allow the user
to repeat this process as many times as the user likes. Initially, the program should inform the user about how
the program will behave. Then the program should prompt the user for each integer that the user wishes to
enter.
The program may be terminated in any of two ways. One way is to have the program halt if the user
enters an integer that”s negative or zero. In this case the user should be reminded with each prompt that the
program can be terminated in that way. Alternatively, after an integer has been entered and the divisors have
been printed, the program can ask the user whether he/she wishes to enter another integer. In this case, when
the user accidentally enters a zero or negative integer to have its divisors calculated, the program should inform
the user that the input is unacceptable and should allow the user to try again (and again!).
Here is an illustration of how the program and the interactive user might interact. The user”s responses
to the program are shown in bold italics.
This program is designed to exhibit the positive divisors of
positive integers supplied by you. The program will repeatedly
prompt you to enter a positive integer. Each time you enter a
positive integer, the program will print all the divisors of
your
integer in a column and in decreasing order.
Please enter a positive integer: 36
36
18
12
9
6
4
3
2
1
Would you like to see the divisors of another integer (Y/N)? y
Please enter a positive integer: -44
-44 is not a positive integer.
Please enter a positive integer: 0
0 is not a positive integer.
Please enter a positive integer: 109
109
1
Would you like to see the divisors of another integer (Y/N)? m
Please respond with Y (or y) for yes and N (or n) for no.
Would you like to see the divisors of another integer (Y/N)? n
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Writedemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
