Question: 4. Write a function called mean that will return the average value of an integer array. The integer array and its length must be passed

4. Write a function called mean that will return the average value of an integer array. The integer array and its length must be passed to the function as parameters. 


5.Write a function called max that will return the index of the max value of an integer array. The integer array and its length must be passed to the function as parameters. 

E.g. array = {1,2,3,4,5,6,7,8,9,0}

max = 9 

index = 8


6.Write a function called variance that calculates and returns the variance of an array that is passed to it as a parameter. Also, pass the length of the array as a parameter. 

variance = mean(array^2) - (mean(array))^2 

array^2 = square of each element of the array

You must use the mean function above in your calculation. 

Step by Step Solution

3.40 Rating (159 Votes )

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 Computer Network Questions!