Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help to solve. This is in programming C++ Thanks! PROBLEM DESCRIPTION Consider daily (either 28 or 30 days) carbon dioxide (CO2) data from a

image text in transcribed

please help to solve. This is in programming C++ Thanks!

PROBLEM DESCRIPTION Consider daily (either 28 or 30 days) carbon dioxide (CO2) data from a green house in unit of parts- per-million (ppm), for every month of January to December for the past three years (ie 2018 and 2020). They are stored in a text file, CO2.txt in the format as shown in Figure 1. The months (represented by months numbers) and corresponding years are stored in file months.txt, in ordered sequence of months and year as shown in Figure 2. The file content format, for instance 1 2019 means January 2019 Assume that for all odd-numbered months (i.e., 1, 3, 5, 7.... 11), only the first 30 days of CO2 amounts are recorded, and for all even-numbered months (i.e., 2, 4, 6,...,12), only the first 28 days of CO2 amounts are recorded as illustrated in Figure 1. CO2_1_for_day1 CO2_1_for_day2 1 2018 2018 2 CO2_1_for_day 30 CO2_2_for_day1 12 2018 1 2019 2 2019 CO2_2_for_day28 : 12 : . 2019 2020 2020 1 2 CO2_11_for_day 30 CO2_12_for_day1 CO2_12_for_day2 12 2020 CO2_12_for_day28 Figure 1: Contents of input file CO2.txt Figure 2: Contents of input file months.txt Suppose you work with a company as a programmer and your employer passes the two files to you. Your job is to write a modular program using 2 structures (one for storing input data and another for output data) to calculate the total co2 amounts for each of the 3 years. These results must be tabulated in a neat table format (named Table 1 with correct table title) displayed on screen and in an output file named outfile.txt. Table 1 must have columns Year and Total CO2 Amount (ppm). Finally, your program must calculate and identify the month with the most total CO2 for each of the three years. This information must be tabulated in another table (named Table 2 with correct table title), to be displayed on screen and in the same file outfile.txt with information of Year, Month Date and Total CO2 Amount (ppm)

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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Write formal and conversational proposals

Answered: 1 week ago

Question

2. Employees and managers participate in development of the system.

Answered: 1 week ago