Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions

Question

Describe the patterns of business communication.

Answered: 1 week ago

Question

=+What is the nature of the unions in the particular country?

Answered: 1 week ago