Question: Below is the stat.cpp Third step Write a function to receive an int array of 8 values as an input parameter and a pointer to

 Below is the stat.cpp Third step Write a function to receive
Below is the stat.cpp
an int array of 8 values as an input parameter and a

Third step Write a function to receive an int array of 8 values as an input parameter and a pointer to a struct of 2 float variables as shown in the accompanying source file stat.cpp. The function is to calculate the mean (average) of the 8 values as a float value, and the variance of the 8 values as a float value. They are stored in the structure and then the function returns. The definition of variance to use is Var = (x,-*..)? where xm is the mean of the data. // An stub to implement a function in #include . #include #include using namespace std; struct statistics { float mean; float variance; void calculate(int *array_ptr, struct statistics *stat_ptr) return; int main() { int user_input[]={7,4,5, 3, 8, 6,5,4}; struct statistics stat; calculate(user_input, &stat); cout

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!