Answered step by step
Verified Expert Solution
Link Copied!

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++

image text in transcribed

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 CO

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

64 Incident and emergency response plans.

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago