Question: An explanation on how to do this lab would be very helpful in my future. Thank you !! The language is C |CS153 Spring 2020
An explanation on how to do this lab would be very helpful in my future. Thank you !!
The language is C

|CS153 Spring 2020 Project 3 #include #include // sqrt is defined here #include // gsort is defined here Functions, function pointers Project description: int calc stats(int data[], int size, double *avg, double *sd); double calc median (int data[], int size); int compare int (const void *inti, const void *int2); //for asort Average: int main() X1 + X2 + ... + xn avg = n int datal[10] = {1,5,2,6,4,8,9,3,7,0}; int data2 [11] = {1,-5,12,-6,34,58,-9,-6,7,10,12}; double avg, sd, median; // call calce stats for datal and data2 and display results Standard deviation: (x1 - avg)2 + (x2 - avg)2 + ... + (xn - avg) sd = n-1 // sort datal, call calc median and display result // repeat the same for data2 return 0; Median: Assuming that {x1,x2,..., Xn; is sorted: n is odd: median = Xn/2 n is even: median = (Xn/2 + X1+n/2)/2 int cal stats(int data[], int size, double *avg, double *sd) // implementation Implement functions, int calc stats (int data[], int size, double *avg, double *sd) cal stats returns 0 and calculates average only if size of array data is equal 1. Otherwise returns 1 and calculates both average, and standard deviation. double cals median(int data[], int size); // implementation double calc median(int data[], int size); cals median returns median value of input data. You must sort data with gsort before you make call to calc median. (Check sorting.c on V drive) int compare int(const void *inti, const void *int2); // implementation