Modify Temperaturefile Class Assignment 5 Add New Function Called Loadtemperaturedata Hea Q37228027

Modify TemperatureFile class from Assignment 5. Add a newfunction called “loadTemperatureData”. The header of this functionis def loadTemperatureData(self, filename). This function uses aloop to load temperatures in the temperature file (filename) to alist and return the list to the caller.

Modify __init__ function to add one more data attribute“temperatureList”. Inside __init__ function, call“loadTemperatureData” function and assign the returned value to“temperatureList”.

Modify calculateAverage function to use the data attribute“temperatureList” to calculate average temperature.

Main function remain unchanged.


Answer


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.