Question: undefined Objective: Learn how to -- use the counter-controlled while loop Problem: Write a C++ program that calculates and outputs the average of a set

undefined Objective: Learn how to -- use the counter-controlled while loop Problem:undefined

Objective: Learn how to -- use the counter-controlled while loop Problem: Write a C++ program that calculates and outputs the average of a set of positive input integers of known size. The program prompts the user to enter the number of integers to input. The program uses a counter-controlled while loop to input each positive integer and to calculate the sum. You can assume the input integers are positive. After the while loop, the program calculates the average. When calculating the average, the program includes an error check to avoid division by zero. The average and the sum should be output as fixed point with two digits after the decimal place. Enter size of list of integers: 4 Enter integer 1: 75 Enter integer 2: 56 Enter integer 3: 89 Enter integer 4: 74 The sum is: 294.00 The average is: 73.50

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!