Question
In C language This program below calculates the mean and the standard deviation of an array of integers. Your program should behave as shown in
In C language
This program below calculates the mean and the standard deviation of an array of integers. Your program should behave as shown in the following example:
Enter the array size: 5 Enter the numbers: 600 470 170 430 300 The mean is 394.00 and the standard deviation is 147.32
Your job is to implement the four functions listed below. You are not allowed to modify anything else.
The following code is downloadable below under Submission Instructions.
#include
#include
int getInt(char prompt[]);
void getData(char prompt[], int array[], int size);
void calcMeanStdDev(int array[], int size, double *pMean, double *pStdDev);
void printResults(double mean, double stdDev);
int main(void) {
int size = getInt("Enter the array size: ");
int array[size];
getData("Enter the numbers: ", array, size);
double mean, stdDev;
calcMeanStdDev(array, size, &mean, &stdDev);
printResults(mean, stdDev);
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started