Question: Im struggling. 1. Write a complete C++ program that reads data into an integer array named tastals (size will be determined from input). The program
1. Write a complete C++ program that reads data into an integer array named tastals (size will be determined from input). The program includes two functions named alsaxa)and calc_variance ). The sals.aua function calculates and returns the average of the values stored in array tastxals Function calc_variance on the other hand, calculates and returns the variance of the data. The formula to calculate variance is given in TABLE Q2 The values returned from salsaxa and calc_variance should be displayed using the cout. statements in main TABLE Q2 Variance = ( xi - x,vg )2 / N Wherei -summation x, = Each value in testvals Avg= Average N-The number of elements in testvals Note: 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.]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
