Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2D Array & File I/O :: Part 3 :: Please use C++ Part 3 - Calculate stats for two dimensional array In this part, you
2D Array & File I/O :: Part 3 :: Please use C++
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 [] [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, value5 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 odd 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 35 row 1: 2 64 0 21 3 2 1 0 row 3:1 WARNING: Make sure to do the calculations by looping individual columns and rows. Values calculated using other methods may result in discrepancies with expected output in COG due to rounding. over CO COStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started