Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Download: http://solutionzip.com/downloads/readnumbers/
- 1. Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered.
- Construct three versions of this program, using the while loop.
- Note. Only use the while loop, not the do-while or for loops.
- Add the following to your program:
- β’A counter within the while loop that keeps track of the number of inputs entered
- β’A comment that determines if the total value is less than 100 or greater than 100, as in the sample output
- β’Switch statements to determine the total number of inputs
- Refer to the following sample output.
- Enter numbers, one per line. Enter 0 to end:
- 7
- 8
- 6
- 5
- 5
- 9
- 8
- 0
- Thank you. The total was 48.
- The total number of inputs read: 8
- The total is less than 100.
- Download: http://solutionzip.com/downloads/readnumbers/
Add Comment
Please, Sign In to add comment