Write a modular program with 3 or more user-defined functions to calculate total CO2 amounts for each month of the three years. Assume that there are 28 days for February of any year.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

8    2020    801.9
8    2020    802.9
8    2020    803.9
8    2020    804.9
8    2020    805.9
8    2020    806.9
8    2020    807.9
8    2020    808.9
8    2020    809.9
8    2020    810.9
8    2020    811.9
8    2020    812.9
8    2020    813.9
8    2020    814.9
8    2020    815.9
8    2020    816.9
8    2020    817.9
8    2020    818.9
8    2020    819.9
8    2020    820.9
8    2020    821.9
8    2020    822.9
8    2020    823.9
8    2020    824.9
8    2020    825.9
8    2020    826.9
8    2020    827.9
8    2020    828.9
8    2020    829.9
8    2020    830.9
9    2020    831.9
9    2020    901.9
9    2020    902.9
9    2020    903.9
9    2020    904.9
9    2020    905.9
9    2020    906.9
9    2020    907.9
9    2020    908.9
9    2020    909.9
9    2020    910.9
9    2020    911.9
9    2020    912.9
9    2020    913.9
9    2020    914.9
9    2020    915.9
9    2020    916.9
9    2020    917.9
9    2020    918.9
9    2020    919.9
9    2020    920.9
9    2020    921.9
9    2020    922.9
9    2020    923.9
9    2020    924.9
9    2020    925.9
9    2020    926.9
9    2020    927.9
9    2020    928.9
9    2020    929.9
10    2020    930.9
10    2020    1001.9
10    2020    1002.9
10    2020    1003.9
10    2020    1004.9
10    2020    1005.9
10    2020    1006.9
10    2020    1007.9
10    2020    1008.9
10    2020    1009.9
10    2020    1010.9
10    2020    1011.9
10    2020    1012.9
10    2020    1013.9
10    2020    1014.9
10    2020    1015.9
10    2020    1016.9
10    2020    1017.9
10    2020    1018.9
10    2020    1019.9
10    2020    1020.9
10    2020    1021.9
10    2020    1022.9
10    2020    1023.9
10    2020    1024.9
10    2020    1025.9
10    2020    1026.9
10    2020    1027.9
10    2020    1028.9
10    2020    1029.9
10    2020    1030.9
11    2020    1031.9
11    2020    1101.9
11    2020    1102.9
11    2020    1103.9
11    2020    1104.9
11    2020    1105.9
11    2020    1106.9
11    2020    1107.9
11    2020    1108.9
11    2020    1109.9
11    2020    1110.9
11    2020    1111.9
11    2020    1112.9
11    2020    1113.9
11    2020    1114.9
11    2020    1115.9
11    2020    1116.9
11    2020    1117.9
11    2020    1118.9
11    2020    1119.9
11    2020    1120.9
11    2020    1121.9
11    2020    1122.9
11    2020    1123.9
11    2020    1124.9
11    2020    1125.9
11    2020    1126.9
11    2020    1127.9
11    2020    1128.9
11    2020    1129.9
12    2020    1130.9
12    2020    1201.9
12    2020    1202.9
12    2020    1203.9
12    2020    1204.9
12    2020    1205.9
12    2020    1206.9
12    2020    1207.9
12    2020    1208.9
12    2020    1209.9
12    2020    1210.9
12    2020    1211.9
12    2020    1212.9
12    2020    1213.9
12    2020    1214.9
12    2020    1215.9
12    2020    1216.9
12    2020    1217.9
12    2020    1218.9
12    2020    1219.9
12    2020    1220.9
12    2020    1221.9
12    2020    1222.9
12    2020    1223.9
12    2020    1224.9
12    2020    1225.9
12    2020    1226.9
12    2020    1227.9
12    2020    1228.9
12    2020    1229.9
12    2020    1230.9
12    2020    1231.9
1    2021    101.9
1    2021    102.9
1    2021    103.9
1    2021    104.9
1    2021    105.9
1    2021    106.9
1    2021    107.9
1    2021    108.9
1    2021    109.9
1    2021    110.9
1    2021    111.9
1    2021    112.9
1    2021    113.9
1    2021    114.9
1    2021    115.9
1    2021    116.9
1    2021    117.9
1    2021    118.9
1    2021    119.9
1    2021    120.9
1    2021    121.9
1    2021    122.9
1    2021    123.9
1    2021    124.9
1    2021    125.9
1    2021    126.9
1    2021    127.9
1    2021    128.9
1    2021    129.9
2    2021    130.9
2    2021    131.9
2    2021    201.9
2    2021    202.9
2    2021    203.9
2    2021    204.9
2    2021    205.9
2    2021    206.9
2    2021    207.9
2    2021    208.9
2    2021    209.9
2    2021    210.9
2    2021    211.9
2    2021    212.9
2    2021    213.9
2    2021    214.9
2    2021    215.9
2    2021    216.9
2    2021    217.9
2    2021    218.9
2    2021    219.9
2    2021    220.9
2    2021    221.9
2    2021    222.9
2    2021    223.9
2    2021    224.9
2    2021    225.9
2    2021    226.9
3    2021    227.9
3    2021    228.9
3    2021    301.9
3    2021    302.9
3    2021    303.9
3    2021    304.9
3    2021    305.9
3    2021    306.9
3    2021    307.9
3    2021    308.9
3    2021    309.9
3    2021    310.9
3    2021    311.9
3    2021    312.9
3    2021    313.9
3    2021    314.9
3    2021    315.9
3    2021    316.9
3    2021    317.9
3    2021    318.9
3    2021    319.9
3    2021    320.9
3    2021    321.9
3    2021    322.9
3    2021    323.9
3    2021    324.9
3    2021    325.9
3    2021    326.9
3    2021    327.9
3    2021    328.9
3    2021    329.9

Everyday, a company records carbon dioxide (CO2) concentration in its green house, in unit of parts-per-million (ppm).
The company has been in operation since the past three years (i.e., from Jan 2019 to Dec 2021). The CO2 concentration
readings are stored in a text file, CO2.txt in the format as shown in Figure 1, where:
The first number in each line of the file is the corresponding month number,
The second number is the year, and
The third is the CO2 concentration in ppm, for the particular day (in sequence) of the month and year.
Suppose the CO2 data recording for the three years are as stored in a file in the format as shown in Figure 1.
1 2018 CO2_day1
1 2018 CO2_day2
Data format: <month year co2_concentration >
1 2018 CO2_day30
2 2018 CO2_day1
2 2018 CO2_day2
2 2020 CO2_day28
12 2021 CO2_day31
Figure 1: Contents of input file CO2.txt
Suppose you work with the company as a programmer and your employer passes file CO2.txt to you. Your job is to:
Write a modular program with 3 or more user-defined functions to calculate total CO2 amounts for each month of
the three years. Assume that there are 28 days for February of any year.
Your program must make use of 2 structures (to store input and output data), apart from other necessary variables.
Only pointers must be used for structure handling, i.e., direct manipulation on structures is not allowed.
The results must be tabulated in a table named Table 1 with the correct table title/caption, to be displayed on
screen and in an output file named CO20utfile.txt.
Transcribed Image Text:Everyday, a company records carbon dioxide (CO2) concentration in its green house, in unit of parts-per-million (ppm). The company has been in operation since the past three years (i.e., from Jan 2019 to Dec 2021). The CO2 concentration readings are stored in a text file, CO2.txt in the format as shown in Figure 1, where: The first number in each line of the file is the corresponding month number, The second number is the year, and The third is the CO2 concentration in ppm, for the particular day (in sequence) of the month and year. Suppose the CO2 data recording for the three years are as stored in a file in the format as shown in Figure 1. 1 2018 CO2_day1 1 2018 CO2_day2 Data format: <month year co2_concentration > 1 2018 CO2_day30 2 2018 CO2_day1 2 2018 CO2_day2 2 2020 CO2_day28 12 2021 CO2_day31 Figure 1: Contents of input file CO2.txt Suppose you work with the company as a programmer and your employer passes file CO2.txt to you. Your job is to: Write a modular program with 3 or more user-defined functions to calculate total CO2 amounts for each month of the three years. Assume that there are 28 days for February of any year. Your program must make use of 2 structures (to store input and output data), apart from other necessary variables. Only pointers must be used for structure handling, i.e., direct manipulation on structures is not allowed. The results must be tabulated in a table named Table 1 with the correct table title/caption, to be displayed on screen and in an output file named CO20utfile.txt.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY