Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

ID: 3918039 • Letter: Y

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 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?

Explanation / Answer

Variables needed:

String Operations required:

Loops needed:

Conditional statements needed:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote