Question: here is the given program to go off of: #include #include int getInt(char *prompt); void getData(int n, int *array); void calcMeanAndStdDev(int n, int *array, double

 here is the given program to go off of: #include #include

here is the given program to go off of:

#include #include

int getInt(char *prompt); void getData(int n, int *array); void calcMeanAndStdDev(int n, int *array, double *pMean, double *pStdDev);

int main(void) { int size=getInt("Enter a positive integer for array size: ");

printf("Enter %d integers: ", size); int array[size]; getData(size, array);

double mean, std_dev; calcMeanAndStdDev(size, array, &mean, &std_dev);

printf("Mean is %g ", mean); printf("Standard deviation is %g ", std_dev);

return 0; }

// Print out the prompt, scan in an integer and return it. int getInt(char *prompt) { printf("%s", prompt); int n; scanf("%d", &n); return n; }

// Do not change anything above this line // // Scan in n (n>0) integers and store them in an array. void getData(int n, int *array) { // add your code here // No [] allowed in this function

}

// Given an array of n (n>0) integers, Calculate the mean and standard deviation. void calcMeanAndStdDev(int n, int *array, double *pMean, double *pStdDev) { // add your code here // No [] allowed in this function

}

Name this program stat.c-You can download the starting stat.c from Blackboard. The program Reads in the array size Calls calcMeanAndStdDev to calculate the mean and the standard deviation Prints the mean and the standard deviation You are asked to implement the getData and calcMeanAndStdDev functions. The following is a sample execution of the program. Enter a positive integer for array size: 5 Enter 5 integers: 600 470 170 430 300 Mean is 394 Standard deviation is 147.323 Please see https://www.mathsisfun.com/data/standard-deviation.html for the math involved

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!