Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write a c++ program Write a program that will allow the user to enter a set of integers (as many as they want), then

Please write a c++ program image text in transcribed
image text in transcribed
image text in transcribed
Write a program that will allow the user to enter a set of integers (as many as they want), then prints out a summary of information, as follows: Prompt the user continually to enter a number using a loop, until the value 0 is entered, which will be the signal to stop entering values. (This is sometimes known as a "sentinel' value). Once the sentinel value has been entered, print out the following information: The total number of values that were entered (not including the ending 0) The sum of the input values The number of values entered that were divisible by 10 (not including the ending 0) The maximum value entered by the user The minimum value entered by the user The average (printed to 1 decimal precision) Your output must match mine exactly. See the sample runs below Sample Runs (user input is underlined, to distinguish it from output) Sample Run 1 Input integer (0 to stop): 12 Input integer (O to stop): 4 Input integer (0 to stop): -1 Input integer (o to stop): 5 Input integer (0 to stop) : 18 Input integer (0 to stop): 0 Total: 5 Sum: 28 Divisible by 10: 0 Max: 18 Min: -5 Avg: 5.6 Sample Run 2 Input integer (0 to stop): 4 Input integer (0 to stop): 8 Input integer (0 to stop) : 27 Input integer (0 to stop): 94 Input integer (0 to stop): -1 Input integer (0 to stop): 43 Input integer (0 to stop): 10 Input integer (0 to stop): 0 Total: 7 Sum: 185 Divisible by 10: 1 Max: 94 Min: -1 Avg: 26.4 Sample Run 3 Input integer (0 to stop) : 0 Total: 0 Sum: 0 Divisible by 10: 0 Max: 0 Min: 0 Avg: 0.0 Sample Run 4 Input integer (0 to stop): 5 Input integer (0 to stop): 0 Total: 1 Sum: 5 Divisible by 10: 0 Max: 5 Min: 5 Avg: 5.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

The company has fair promotion/advancement policies.

Answered: 1 week ago