Write a program that reads numbers from cin and then sums them, stopping when 0 has been entered 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 as an example: Enter numbers, one per line. Enter 0 to end:

7
8
6
5
9
8
0

Thank you. The total was 48.

The total number of inputs read: 8
The total is less than 100
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.