Question: One week temperatures data has been recorded for 6 different cities. Write a function, named findFreezing Cities, that takes as parameter a two-dimensional array named,

 One week temperatures data has been recorded for 6 different cities.

One week temperatures data has been recorded for 6 different cities. Write a function, named findFreezing Cities, that takes as parameter a two-dimensional array named, temperatures of size 6 x 7, that contains cities' temperatures in which each row represents a city and each column represents one-day temperature. The function should find and display the weekly average temperature for each freezing city. A city is considered freezing if the temperature is below 0 for at least four days in one week. Format the weekly average to 2 decimal places. For example, if the array temperatures, contains the following data: 6 Days Temperatures 0 1 2 3 4 5 C 0 5 11-1 -3 0 2 1 1 7 -4 0-2 1 -5 t 2 -2-5 -5 -4 3 1 i 3 7 -4 0 -2 1 5 4 -1 -1 -1 -2 3 S 5 3 5 1 1 0 -2 -4 -1 ww-D 12 -2 2 Then the output of the function should be displayed as follows (note that highlighted rows indicate freezing cities.): Freezing Cities Weekly Averages: City# Average 2 -1.00 3 -1.85 -0.14

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!