Question: Assignment Write a class called Temperature File. The class has one data attribute : filename Write getter and setter for the data attribute. Write a

 Assignment Write a class called Temperature File. The class has one

Assignment Write a class called Temperature File. The class has one data attribute : filename Write getter and setter for the data attribute. Write a 'calculate Average function (signature be low) to calculate and return average temperature of all temperatures in the file. Use loop! def calculate Average(self) . Handle possible exceptions Write a main function: . Create a file ('Temperatures.txt) and then use "write method to write temperature values on each line. These values can be hard coded or gathered from user input loop. Create an object ofthe Tempera ure File with the filename (Tempe ratures.txt') just created. Use the object to call calcuate Average function and print out the returned average temperature. . . Handle possible exceptions in ma in function. Copyight 02015 Pca non Ed uc a tios, ine Pub lohing as Pea nson Add son-We sby

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!