Write an entire c++ program that reads a positive integer

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

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

Reference no: EM13338990

Questions Cloud

What is the volume of the secret cavity : A small sculpture made of brass (rbrass = 8470 kg/m^3) is believed to have a secret central cavity. What is the volume of the secret cavity
How many integer values are in the array : Write a function named "location_of_largest" that takes as its arguments the following.
What is the acceleration of gravity on this planet : You have just landed on a planet. You take out a block of mass 245g , release it from rest from a height of 14.01m, What is the acceleration of gravity on this planet
Determine the loss rate of particles from jeans escape : Determine the flux of particles escaping from the exobase of Earth's atmosphere using a number density at the exobase of 10^5 particles/cm^3 and a temperature of 700K.
Write an entire c++ program that reads a positive integer : 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.
Estimate how far from site of impact resulting shock front : Suppose a 100m diameter stony (p= 3 g/cm^3) meteroid impacts the Earth with a speed of 20km/s. Assume all kinetic energy goes into the creation of an atmospheric blast wave.
Find the speed of the car at the top of the circle : A roller coaster shown below is built in your town. The radius of the circular part is 20 meters. As a physics student, you are invited to take the first ride. Find the speed of the car at the top of the circle
Calculate the emission temperature of the earth : calculate the emission temperature of the earth, if the planetary albedo is changed to that of ocean areas without clouds, about 10%
The ideas of others and synthesizing those ideas : Since this class is centered on the practice of working with the ideas of others and synthesizing those ideas into our own writing

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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