Question: Use C++: Calculate states for two dimensional array Part 3 - Calculate stats for two dimensional array In this part, you will be working with
Use C++: Calculate states for two dimensional array

Part 3 - Calculate stats for two dimensional array In this part, you will be working with a two dimensional array float arrayStats (string filename, float numbers [l [5]) The arrayStats function takes in two arguments: a filename and a 2D array of floats that can hold 5 floats in each row. The input file will have the same format as the file in Part 2 You can call fillArray in this function. The input file will have a variable number of rows but exactly 5 floats on each row, and a header line Format of Input File valuel, value2, value3, value4, value 4, 1, 2, 3.8, 5 2, 3.2, 4, 1, 0 6, 4, 0, 2.5, -1 5, -3, 2, 1, 0 Read in the values from the input file, then calculate the mean of every odd row and odod column (row/column 1, 3 ,...) and sum these values. Return the sum as a float. For this example, the sum of the means of the odd columns is 3.4 and the sum of the means of the odd rows is 3. So the function arrayStats should return 6 . 4 Mean of 4 1 2 3 5 row 1: 2 64 0 2-1 3 2 1 0 row 3: 1 WARNING: Make sure to do the calculations by looping over individual columns and rows. Values calculated using other methods may result in discrepancies with expected output in COG due to rounding 7
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
