Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are to create a program that: Reads a file called weather.txt that contains the amount of (r)ain and (s)now on a given day where
You are to create a program that:
- Reads a file called weather.txt that contains the amount of (r)ain and (s)now on a given day where it rained or snowed. This data was collected for a year and only represents rain/snow days
- From this file
- Capture the number of days of rain
- Capture the amount of rain on that day. It is provided in inches
- Calculate the total the amount of rain for the year in feet and inches
- Give the average amount of rain per day in inches
- Capture the number of days of snow
- Capture the amount of snow on that day. It is provided in inches
- Calculate the total the amount of snow for the year in feet and inches
- Give the average amount of snow per day in inches
- Read all the data from the file.
Data.TXT In File
r 10
s 4
s 11
s 10
r 3
r 3
r 8
r 3
r 10
r 12
r 4
r 6
r 6
r 12
s 6
r 8
s 9
r 2
r 1
s 11
r 12
s 6
r 10
r 10
r 6
r 11
r 5
r 12
s 10
r 7
s 2
r 4
s 8
r 8
s 6
r 9
r 3
r 10
s 11
r 4
r 10
s 4
s 5
r 8
r 1
r 2
s 5
r 4
r 1
r 1
s 5
r 2
r 5
s 1
r 5
r 5
r 2
s 5
r 5
r 4
s3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started