Question: SOLVE IN C++ Note: There is no input file: write the code as if there is an input file according to the specifications Question 1

SOLVE IN C++

SOLVE IN C++ Note: There is no input file: write the codeas if there is an input file according to the specifications Question

Note: There is no input file: write the code as if there is an input file according to the specifications

Question 1 (30 points) CT Disinfection is the current disinfection standard used in many jurisdictions in North America. It's used to demonstrate the level of disinfection treatment in your water. CT is simply the concentration of chlorine in your water times the time of contact that the chlorine has with your water. CT value (in mg/L-min) is calculated using formula given below: 2 CT V Cl(t)+Cl(t-1) x x f Flow(t) where, Vis Volume = 8070 m. B, is the Baffling factor = 0.7. Flow(t) is the flow at time t Cl(t) is the Chlorine Concentration at time t Cl(t-1) is the Chlorine Concentration at time t-1 (or previous t) Write a program that will read data from a file and calculate the CT values. The file has three columns where the first column contains time (t) values, 2nd column contains flow at time t, and 3rd column contains Chlorine concentration at time t. When the program runs, it will ask the user to enter the size of an array. If the size of an array is less than or equal to zero, it should display an error message and ask the user to re-enter the value until it is valid. The program then dynamically allocate memory spaces for three 1-D arrays to hold data given in the file. It reads data from a file and stores in to arrays. The main() function should calculate CT values using calculateCT() function and display the output in table format with additional column for CT values. All real numbers must be displayed in 1 decimal format and integer values without decimal. Use pointer notation rather than array notation throughout this problem. calculateCT() function: This function will accept the size and three arrays created above, and return a pointer to the calculated array containing CT values. Use above formula to calculate CT values and store in to a dynamically allocated array. For the first time measurement assume Cl(t-1) = Cl(t)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!