Question: Statistics (stat.c) Write a program that allows the user to enter a series of numbers and calculate the running average of these numbers as the

Statistics (stat.c) Write a program that allows the user to enter a series of numbers and calculate the running average of these numbers as the program executes, also keep track of the minimum and maximum value as the program runs. The program runs inside an infinite loop that is terminated when the number -999 is entered as the input choice. Print out statistics each time for the total(summation), average(mean), minimum number, and maximum number as the program runs. The different calculations should each be done in their own independent function separate from the main.

Implement these functions:

double mean(double sum, int n);

double min(double n, double min);

double max(double n, double max);

void print(double total, double avg, double min, double max);

THE PICTURE SHOWS THE OUTPUT:

Statistics (stat.c) Write a program that allows the user to enter a

Language in C...not C++

Please enter a value (-999 to quite) 1 total 1.000000 avg: 1.000000 minimum value: 1.000000 maximum value 1.000000 Please enter a value (-999 to quite) 2 total 3.000000 avg: 1.500000 minimum value: 1.000000 maximum value 2.000000 Please enter a value (-999 to quite) 4 total 7.000000 avg: 2.333333 minimum value 1.000000 maximum value 4.000000 Please enter a value (-999 to quite) -999 Final Statistics: total 7.000000 avg: 2.333333 minimum value: 1.000000 Maximum value: 4.000000

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!