for this question we are supposed to use a file called lake

** for this question we are supposed to use a file called \"lake powell\" I didnt upload this file to the question but I just need to know what the code would look like

Nested Loops 9.17 In the previous chapter, the water elevation data for Lake Powell were evaluated using the find function. Repeat the calculations, using a nested loop structure.

(a) Determine the average elevation of the water level for each year and for the eight-year period over which the data were collected.

(b) Determine how many months each year exceed the overall average for the eight-year period.

(c) Create a report that lists the month (number) and the year for each of the months that exceed the overall average. For example, June is month 6.

(d) Determine the average elevation of the water for each month for the eight-year period

Solution

Answer: -

Given 8 year

First we have to calculate average elevation of the water level for each year.

average elevation of the water level for year one(e_y1) = (each month water elevation of year one)/12

average elevation of the water level for year two(e_y2) = (each month water elevation of year two)/12

average elevation of the water level for year three(e_y3) = (each month water elevation of year three)/12

average elevation of the water level for year four(e_y4) = (each month water elevation of year four)/12

average elevation of the water level for year five(e_y5) = (each month water elevation of year five)/12

average elevation of the water level for year six(e_y6) = (each month water elevation of year six)/12

average elevation of the water level for year seven(e_y7) = (each month water elevation of year seven)/12

average elevation of the water level for year eight(e_y8) = (each month water elevation of year eight)/12

As the water elevation data for Lake Powell were evaluated using the find function.

assume eight-year water elevation is e_y1, e_y2, e_y3, e_y4, e_y5, e_y6, e_y7, e_y 8

Average elevation of eight years = Add all eight-year water elevation/ 8.

         = (e_y1+e_y2+ e_y3+e_y4+ e_y5+ e_y6+ e_y7+ e_y 8)/8

(b) Determine how many months each year exceed the overall average for the eight-year period.

Answer: -

Here we have to calculated each month water elevation and then compare with average elevation with respective year average elevation.

If any month water elevation is greater than respective year average elevation, then print that.

Answer: -

Here we have to calculated each month water elevation and then compare with overall average.

If it is greater than print it.

(d) Determine the average elevation of the water for each month for the eight-year period

Answer: - Here we have to add each month water elevation for the eight-year period and then divide 96.

---------------------------------------------------------------------------------------------

If you have any query, please feel free to ask.

Thanks a lot.

** for this question we are supposed to use a file called \
** for this question we are supposed to use a file called \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site