Question: You are asked to conceptualize the solution to a problem without coding it in Python. The problem is as follows:You are provided with a text

You are asked to conceptualize the solution to a problem without coding it in Python.

The problem is as follows:You are provided with a text file containing daily rainfall amounts for

a city over a period of time. Each line in the file contains a date with the format mm/dd and a

rainfall amount on that day (expressed as a real value > = 0.0, where 0.0 denotes a dry day). The

date and rainfall amount are separated by a space and the text file has at least one entry in it. You

may assume that the name of the file is known (i.e. theres no need to prompt the user to input the

file name). The problem is to compute the following statistics based on the data in the file:

The number of days it rained

The maximum rainfall amount

The average rainfall amount

Sample input file:

11/01 1.23

11/02 0.05

11/03 0 . 0

11/04 2.91

11/05 0 . 0

11/06 1.31

1. List all the variables that would be needed to solve this problem. For each variable,

provide a name, data type, and a brief description (e.g. input_done is a Boolean used to

determine if the user finished inputting values).

2. Are any string operations needed to solve this problem? If so, state which and brief

describe what they achieve.

3. Is either a while or a for-loop needed to solve the problem? If so, identify which

kind of loop. What does the loop achieve? What condition needs to be true for the loop to

terminates?

4. Is a conditional statement needed to solve the problem? If so, what does it achieve?

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!