File temp.txt has the temperature of each day during the year of 2022 in UAE. Therefore, the file includes 365 records. Each record defines as (Day Number} {Month Short Name} {Morning Temperature} {Noon Temperature} {Evening Temperature). For example, the first record is: 1 JAN 10 15 12. Day Number Month Short Name Evening Temperature Noon Temperature Morning Temperature

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
Question
File temp.txt has the temperature of each day during the year of 2022 in UAE. Therefore, the file includes 365
records. Each record defines as (Day Number} {Month Short Name) {Morning Temperature} {Noon
Temperature} {Evening Temperature). For example, the first record is:
1 JAN 10 15 12
Requirements:
.
.
Day
=====
1
2
3
Day Number
4
Create a menu program to enable the user to select between several options, which are:
1. Print details for a day: will ask the user for the day and the month, and display the details of the
day in a proper tabular format. For example, if the user enters the day as 10 and the Month as
'JAN', the output will be as the following: (MT, NT, ET are for morning, noon and evening
temperature)
Day
10
5
6
7
8
Month Short Name
JAN
JAN
JAN
JAN
JAN
JAN
JAN
JAN
Morning Temperature
Month
JAN
:
:
Month MT
2. Print details for a month: will ask the user for the month, and display the details of the month in
a proper tabular format. For example, if the user enters Month as 'JAN', the output will be as
the following:
10
15
14
12
MT
15
10
15
14
Noon Temperature
14
NT
SSSAAZAN
15
16
15
17
17
22
17
Evening Temperature
NT
24
22
HHHHHHHH
ET
=====
12
14
12
13
12
15
ET
14
15
14
3. Print average of temperature for a day: will ask the user for the day and the month, and display
the average of the day.
4. Print average of temperature for a month: will ask the user for the month, and display the
average for that month..
5. Print average of temperature for the year: will display the average for that whole year.
6. Print minimum of temperature for a day: will ask the user for the day and the month, and
display the minimum of that day.
7. Print minimum of temperature for a month: will ask the user for the month, display the
minimum for that month, and define in which day in the month it was recorded.
8. Print minimum of temperature for the year: will display the minimum for that whole year, and
define in which day in the year it was recorded.
9. Print maximum of temperature for a day: will ask the user for the day and the month, and
display the maximum of that day.
10. Print maximum of temperature for a month: will ask the user for the month, display the
maximum for that month, and define in which day in the year it was recorded.
11. Print maximum of temperature for the year: will display the maximum for that whole year, and
define in which day in the year it was recorded.
12. Exit: to terminate the program
NOTES:
A. Before displaying any of the results for the options (1-11), the user will be asked if saving to an
external file is required beside displaying to the console. By saving to a file, the program must
add the results to the existing data.
B. Create at least a separate function for each option, except option 12. And also add any other
functions as needed to support your program.
Transcribed Image Text:File temp.txt has the temperature of each day during the year of 2022 in UAE. Therefore, the file includes 365 records. Each record defines as (Day Number} {Month Short Name) {Morning Temperature} {Noon Temperature} {Evening Temperature). For example, the first record is: 1 JAN 10 15 12 Requirements: . . Day ===== 1 2 3 Day Number 4 Create a menu program to enable the user to select between several options, which are: 1. Print details for a day: will ask the user for the day and the month, and display the details of the day in a proper tabular format. For example, if the user enters the day as 10 and the Month as 'JAN', the output will be as the following: (MT, NT, ET are for morning, noon and evening temperature) Day 10 5 6 7 8 Month Short Name JAN JAN JAN JAN JAN JAN JAN JAN Morning Temperature Month JAN : : Month MT 2. Print details for a month: will ask the user for the month, and display the details of the month in a proper tabular format. For example, if the user enters Month as 'JAN', the output will be as the following: 10 15 14 12 MT 15 10 15 14 Noon Temperature 14 NT SSSAAZAN 15 16 15 17 17 22 17 Evening Temperature NT 24 22 HHHHHHHH ET ===== 12 14 12 13 12 15 ET 14 15 14 3. Print average of temperature for a day: will ask the user for the day and the month, and display the average of the day. 4. Print average of temperature for a month: will ask the user for the month, and display the average for that month.. 5. Print average of temperature for the year: will display the average for that whole year. 6. Print minimum of temperature for a day: will ask the user for the day and the month, and display the minimum of that day. 7. Print minimum of temperature for a month: will ask the user for the month, display the minimum for that month, and define in which day in the month it was recorded. 8. Print minimum of temperature for the year: will display the minimum for that whole year, and define in which day in the year it was recorded. 9. Print maximum of temperature for a day: will ask the user for the day and the month, and display the maximum of that day. 10. Print maximum of temperature for a month: will ask the user for the month, display the maximum for that month, and define in which day in the year it was recorded. 11. Print maximum of temperature for the year: will display the maximum for that whole year, and define in which day in the year it was recorded. 12. Exit: to terminate the program NOTES: A. Before displaying any of the results for the options (1-11), the user will be asked if saving to an external file is required beside displaying to the console. By saving to a file, the program must add the results to the existing data. B. Create at least a separate function for each option, except option 12. And also add any other functions as needed to support your program.
Expert Solution
steps

Step by step

Solved in 3 steps

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