Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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:
\table[[\table[[Day],[temperature]],Day 1,Day 2,Day 3,Day 4,Day 5],[40F,105,156,142,123,131],[50F,201,213,212,199,222],[60F,98,82,92,78,89],[70F,4,10,13,6,9]]
The data you need is presented in a 2-D array format. Therefore, your program should create a two dimensional array of 4 rows and columns, total of 20 integers.
The array will be filled by the input file bacteria.txt.
Next display all of the values (in a 2-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 ROW SIZE =4;
const int COL_SIZE =5; //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 getData(int data[][COL_SIZE], 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 displayData(const int data[][COL_SIZE], const int ROW);
You have to use left
Sample Display:
Program TwoDArray.cpp Results
The bacteria data is:
\table[[105,156,142,123,131],[201,213,212,199,222],[98,82,92,78,98],[4,10,13,6,9]]
The total for all readings was 2194
The average of all data is: 109.70
The highest value of all data is: 222
Please enter a row number so I can show you the sum of that row: 6
Invalid row number entered; please reenter: 5
Invalid row number entered; please reenter: 4
The sum of row 4 is 42
Please enter a column number so I can show you the lowest value in that column: 6
Invalid column number entered; please reenter: 5
The lowest of col 5 is 9
Bacteria.txt
105,156,142,123,131
201,213,212,199,222
98,82,92,78,98,
4,10,13,6,9
image text in transcribed

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_2

Step: 3

blur-text-image_3

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

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

=+Is the sex appropriate for the audience?

Answered: 1 week ago

Question

Select the number that is equal to 3 0

Answered: 1 week ago