Question: Write a program that repeatedly reads integers from the user until the user enters the word 'stop' (this is called a sentinel value). When the

Write a program that repeatedly reads integers from the user until the user enters the word \\\\\\\'stop\\\\\\\' (this is called a sentinel value). When the user enters the sentinel value, output the following statistics about the sequence of integers: sum, average, sum of even numbers, and the largest number.

For example: Enter a sequence of integers. Enter \\\\\\\'stop\\\\\\\' to exit.

> 1

> 3

> 1

> 3

> 4

> 9

> 3

> stop

Sum: 24

Average: 3.4285714285714284

Even Sum: 4

Largest number: 9

Step by Step Solution

3.54 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem you would need to write a program that can handle user input and perform calculations on the inputted integers Heres a stepbyste... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!