Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python 3 Suppose there is a class AirConditioner . The class supports the follow

ID: 653967 • Letter: P

Question

Python 3

Suppose there is a class AirConditioner . The class supports the following behaviors: turning the air conditioner on, off, setting the desired temperature, and telling the previously set temperature. The following methods are provided for these behaviors: turn_on and turn_off , which accept no arguments and return no value, set_temp , which accepts an int argument and returns no value, and get_temp , which accepts no valueand returns an int .


There is a reference variable  my_ac to an object of this class, which has already been created. There is also a variable called current_temp , which has already been initialized. Invoke a method using the reference variable which returns the previously set temperature of the air conditioner, and store the returned value in current_temp .

Explanation / Answer

class AirConditioner:

   def turn_on():
  
  

   def turn_off():
  

  
   def set_temp(int v):
  

  

   def int get_temp():
  
def main():
  
   my_ac=AirConditioner()

   my_ac.turn_on()

   my_ac.turn_off()

   my_ac.set_temp(15)

val=my_ac.get_temp()