Suppose Class Airconditioner Class Supports Following Behaviors Turning Air Conditioner F Q37106620

Suppose there is a class AirConditioner. The class supports thefollowing behaviors: turning the air conditioner on and off. Thefollowing methodsare provided for these behaviors:turn_on and turn_off. Both methods accept noarguments and return no value.

There is a reference variable my_ac to anobject of this class, which has already beencreated. Invoke a method to turn the air conditioneroff.

Instructor Notes:

You are ONLY writing one statement for this question.


Answer


To call function turn_off with referencevariable my_ac the code is as below.

my_ac.turn_off ();

Leave a Comment

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