Question: write the program in python please Instructions Write a program that allows users to enter monthly average temperatures for one to five years. The program

write the program in python please  write the program in python please Instructions Write a program that
allows users to enter monthly average temperatures for one to five years.
The program should be named lab01.py. The program will prompt for: -
The city name from which the temperature data was obtained - The
number of years (15) worth of data to be entered - The

Instructions Write a program that allows users to enter monthly average temperatures for one to five years. The program should be named lab01.py. The program will prompt for: - The city name from which the temperature data was obtained - The number of years (15) worth of data to be entered - The starting year of the data - Then the user enters 12 months of data for each year that was specified Use a named constant of WW_AVG that will hold the value of 61.0. This is the worldwide average temperature. The program will keep a running total of the temperatures entered by the user. After the user enters data, the program will display the average temperature for the city and convert and display the average temperature in Celsius. It will then show the difference from the worldwide average temperature and state whether the local average is hotter, colder, or the same as the worldwide average. Here is a dataset from the San Antonio International Airport that you can use to test Table 1: Observed Average montmy Prompts: Use the following prompts to get data from the user (input shown in red): 1. Get the name of the city and assign the text string to a variable: City name of data source: San Antonio 2. Use the text from the city name in the following prompt: How many years' worth of data for San Antonio would you like to enter (15)? How many years? 2 a. Use an input validation loop to ensure that if the number entered is less than one or greater than five, an error message should be displayed and prompt the user to try again. How many years' worth of data for San Antonio would you like to enter (15)? How many years? 9 Please enter a value between 1 and 5 . Please enter the number of years: 0 Please enter a value between 1 and 5 . Please enter the number of years: 2 3. Get the number of the first year's data: Please enter the starting year: 202 4. Using a loop, get 12 months' worth of data for every year specified: For the year 2020: Please enter the average temperature for month 1: 57.58 Please enter the average temperature for month 2: 55.30 Please enter the average temperature for month 3:67.69 Please enter the average temperature for month 4:69.53 Please enter the average temperature for month 5: 77.19 Please enter the average temperature for month 6: 81.86 Please enter the average temperature for month 7: 86.16 Please enter the average temperature for month 8:86.75 Please enter the average temperature for month 9: 77.85 Please enter the average temperature for month 10:71.41 Please enter the average temperature for month 11: 64.74 Please enter the average temperature for month 12: 54.27 For the year 2021: Please enter the average temperature for month 1: 53.31 Please enter the average temperature for month 2:48.93 Please enter the average temperature for month 3: 64.06 Please enter the average temperature for month 4:69.29 Dutput After the data is entered, as shown above, the output should look exactly like the ollowing: The average temp for San Antonio from 22 to 2022 is: 70.07F\21.15C That average is 9.07F hotter than the worldwide average temperature of 61.00F. Hints: - Do not hard code the city name. It should come from the user's entry. - The formula for calculating Celsius from Fahrenheit is: Celsius=95(Fahrenheit32) - It is not in the book, but you should use the abs() function to get the absolute value of the difference between the local average and the worldwide average. For example: diff =abs(200500) The value stored in diff will be 300 , not 300. - The starting year should match the user's entry. - The ending year should be the starting year, plus the number of years. - Use a decision tree and concatenation to display hotter than, cooler than, or the same as. If the local average is greater than the worldwide average, the output should be: That average is 9.07F hotter than the worldwide average temperature of 61.00F. If the local average is less than the worldwide average, the output should be: That average is 9.07F cooler than the worldwide average temperature of 61.00F. If the local average is the same as the worldwide average, the output should be: That average is the same as the worldwide average temperature of 61.00F. - Do not hard code the worldwide average. Use the named constant variable. in the examples above, the blue text in the output shows where decisions, lculations, or variablesamed constants will be used

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!