Write a program that repeatedly reads integers from the user until the user enters the word 'stop'
Fantastic news! We've Found the answer you've been seeking!
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 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
Related Book For
Database Systems A Practical Approach to Design Implementation and Management
ISBN: 978-0132943260
6th Edition Global
Authors: Thomas Connolly, Carolyn Begg
Posted Date: