Question: (Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in
(Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate and return the average of values stored in an array named testvals. The array should be declared in main() and include the values 89, 95, 72, 83, 99, 54, 86, 75, 92, 73, 79, 75, 82, and 73. The variance() function should calculate and return the variance of the data. The variance is obtained by subtracting the average from each value in testvals, squaring the values obtained, adding them, and dividing by the number of elements in testvals. The values returned from calcavg() and variance() should be displayed by using cout statements in main().
THIS IS A PROBLEM FROM C++ FOR ENGINEERS AND SCIENTISTS fourth edition by GARY J. BRONSON. Chp 7.4 question #7. THIS question is on chegg but it does not make any sense PLEASE HELP
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
