Answered step by step
Verified Expert Solution
Question
1 Approved Answer
TwoDArray.cpp Due: Sept 4 by 9 : 0 0 a . m . Program Description: You are working in a biology lab as a data
TwoDArray.cpp
Due: Sept by :am
Program Description:
You are working in a biology lab as a data scientist. Your job is to collect and analyze all
data of a special type of bacteria. After a few days of tracking the number of bacteria
growth for each day at the specified temperatures, here are the data generated:
The data you need is presented in a D array format. Therefore, your program should
create a two dimensional array of rows and columns, total of integers.
The array will be filled by the input file bacteria.txt
Next display all of the values in a D table format, with rows and columns, format the
display use setw function. Your output format should match my sample output listed
below
The program should also display the average value of all data the average should have
two decimals
The program should display the highest value for all data.
The program should also display the sum for a certain temperature requested row
sum You must validate that the row requested is a valid value.
The program should display the lowest value for a certain day column lowest You
must validate that the column requested is a valid value.
Program Structure:
Declare two constant variables.
const int ROWSIZE ;
const int COLSIZE ; only the column size should be declared as global constant
The following functions must be included, but you may add additional functions if you
wish.
with bacteria.txt file input
getData This function should pass a two dimensional array, and its row size. The
function fills with the array with the data in the bacteria.txt file.
void getDataint dataCOLSIZE const int ROW;displayData This function should be passed by array. The function will display
all grades in the format shown on the back of this page.
void displayDataconst int dataCOLSIZE const int ROW;
You have to use left to manipulate the output
getAllAverage This function should pass the array, the number of rows. The
function should calculate the average for all numbers and return the average
double getAllAverageconst int dataCOLSIZE const int ROWSIZE;
Average of the all numbers must be stored as a "double" type. Please use
staticcast to avoid integer divisions
No display messages in this function.
getAllHighest This function should pass the array, the number of rows. The
function should find the highest for all numbers and return the highest
int getAllHighestconst int dataCOLSIZE const int ROWSIZE;
No display messages in this function.
getRowSum This function should pass the array, the row number requested. The
function should calculate and then return the sum.
int getRowSumconst int dataCOLSIZE const int ROWREQUESTED;
No display messages in this function
Remember array indices always starts from so If ROWREQUESTED
is you are finding data
You can pass the total row size here as a parameter, but it's not necessary.
Why do you think sothink about it only
getColLowest This function should be passed an array parameter, the size of the
rows, and the column number requested. It should find the lowest of that column
and then return the value
int getColLowestconst int dataCOLSIZE const int ROWSIZE, const int
COLREQUESTED;
No display messages in this function
Remember array indices always starts from so If COLREQUESTED is
you are finding datarow
Data Storage:
Data should be stored in a twodimensional array. Additional variables should be
used as appropriate.
Other Requirements:
Use the provided function headers mentioned above
Your output should be similar to the provided output attached below including
format and messages.
Please use setw to format your output
Please use setprecision to restrict your decimal displays to decimal places.
Please follow the program style guidelines carefully
Main function should only call other functions and display messages.Program TwoDArray.cpp Results
The bacteria data is:
The total for all readings was
The average of all data is:
The highest value of all data is:
Please enter a row number so I can show you the sum of that row:
Invalid row number entered; please reenter:
Invalid row number entered; please reenter:
The sum of row is
Please enter a column number so I can show you the lowest value in that
column:
Invalid column number entered; please reenter:
The lowest of col is
C:IUserslcarolDesktopIStans StuffCOSCOAProgramming II
FallProgram AssignmentsProgram Assignment VAssignment
Completed DebugAssignmentexe process exited with code
Press any key to close this window
Step 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