Question: Write a program called DistanceFromAverage which allows a user to enter up to 1 5 double values. The user should enter 9 9 9 9

Write a program called DistanceFromAverage which allows a user to enter up to 15 double values. The user should enter 9999 to quit entering numbers. Display an error message if the user quits without entering any numbers; otherwise, display a count of the numbers entered, the arithmetic average of the numbers, and each entered value and its distance from the average.
An example of the program is show below:
Enter a numeric value or 99999 to quit 12.2
Enter next numeric value or 99999 to quit 11
Enter next numeric value or 99999 to quit 18.2
Enter next numeric value or 99999 to quit .5
Enter next numeric value or 99999 to quit 99999
You entered 4 numbers and their average is 10.475
12.2 is 1.7249999999999996 away from the average
11.0 is 0.5250000000000004 away from the average
18.2 is 7.725 away from the average
0.5 is -9.975 away from the average
 Write a program called DistanceFromAverage which allows a user to enter

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!