Question: 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

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!