Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

9th Edition

0135188148, 978-0135188149, 9781642087611

More Books

Students also viewed these Databases questions

Question

What is the relationship between diversity, inclusion, and equity?

Answered: 1 week ago