akosiraff

Download ReadNumbers

Aug 25th, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/readnumbers/
  3. 1. Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered.
  4. Construct three versions of this program, using the while loop.
  5. Note. Only use the while loop, not the do-while or for loops.
  6. Add the following to your program:
  7. •A counter within the while loop that keeps track of the number of inputs entered
  8. •A comment that determines if the total value is less than 100 or greater than 100, as in the sample output
  9. •Switch statements to determine the total number of inputs
  10. Refer to the following sample output.
  11. Enter numbers, one per line. Enter 0 to end:
  12. 7
  13. 8
  14. 6
  15. 5
  16. 5
  17. 9
  18. 8
  19. 0
  20. Thank you. The total was 48.
  21. The total number of inputs read: 8
  22. The total is less than 100.
  23.  
  24. Download: http://solutionzip.com/downloads/readnumbers/
Add Comment
Please, Sign In to add comment