Question: Make a class called Temperature. 1. The __init__ method for Temperature should store two attributes: scale and measure. The attribute scale is a string and

Make a class called Temperature.

1. The __init__ method for Temperature should store two attributes: scale and measure. The attribute scale is a string and the measure a float. The init method should allow the creation of an instance providing values for the attributes.

2. Make a method called describe_ temp that prints these two pieces of information,

3. Make a method called printscale. The method checks if the value of the scale is Celsius and if yes it prints a message the temperature scale is Celsius otherwise it prints The temperature it is not in Celsius.

4. Make a method called setmeasure that will set the measure to a given value

5. Make a method called getmeasure that will return the measure

6. Make one instance of the Temperature class and name it mytemperature and provide initial values of your choice.

7. Use the merhod describe_ temp to print the attributes

8. Use the method printscale to print the message.

9. Use the method setmeasure to change the measure to one of your choice.

10. Use the method getmeasure to print the measure

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!