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

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

Write a function, named findFreezingCities, that takes as parameter a two-dimensional array

One week temperatures data has been recorded for 6 different cities. Write a function, named findFreezingCities, 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 O 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: Days Temperatures 0 1 2 3 4 5 5 11 -1 -30 2 1 1 7 -4 0 -2 1 -5 7 2 -2 -5 -5 -4. 3 1 7 3 7 -4 0-2 1 5 e 4 -1 -1 -2 3 3 S 3 5 1 0-3 6 -2 -4 -1 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 5 -0.14 One week temperatures data has been recorded for 6 different cities. Write a function, named findFreezingCities, 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 O 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: 0 C 0 5 1 1 7 1 2 -2 i 3 7. e 4 -1 S 3 Days Temperatures 1 2 3 4 5 11 -1 -3 0 2 -4 0 -2 1 -5 -5 -5 -4 3 1 -4 0-2 1 5 -1 -1 -2 B 3 5 1 1 0 -3 6 -2 -4 -1 12 -2 2 Then the output of the function should be displayed as follows (note that highlighted Tows indicate freezing cities.): Freezing Cities Weekly Averages: City# Average 2 -1.00 3 -1.85 -0.14 5

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!