Question: Q1) Rainfall Statistics PYTHON Design a program called RainfallStatistics.py that contains the following functions: main function, totalRainfall, averageMonthlyRainfall, lowestHighestRainfall, and largerThanN The main function generates

Q1) Rainfall Statistics PYTHON

Design a program called RainfallStatistics.py that contains the following functions: main function, totalRainfall, averageMonthlyRainfall, lowestHighestRainfall, and largerThanN

The main function generates a list called monthlyRainfallData of 12 random floating-point numbers between 0 and 10. Each number represents total rainfall for each month.

totalRainfall: This function accepts the list of monthly rainfall data and returns total rainfall for the year average

MonthlyRainfall: This function accepts the list of monthly rainfall data and returns average monthly rainfall

lowestHighestRainfall: This function accepts the list of monthly rainfall data and returns a tuple of four values: lowest rainfall, corresponding month, highest rainfall, corresponding month.

For example: (2.82, February, 4.95, September)

Assume that each index of the list of twelve numbers corresponds to a month. For example 0=January, 1=February,11=December. largerThanN This function accepts the list of monthly rainfall data and a floating-point number n.

This function displays all rainfalls in the list that are greater than the number n and the corresponding months.

For example, assume n = 3.24. Then, the function displays:

4.23 : October

3.87 : September

5.56 : November

The main function builds the random list, accepts the number n, and calls each of the functions.

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!