Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off, and checking if the air conditioner is on or off. The following methods provide this behavior: turnOn and turnOff, setTemp, and isOn, which accepts no argument and returns a boolean indicating whether the air conditioner is on or off. Assume there is a reference variable myAC to an object of this class, which has already been created. There is also a boolean variable status, which has already been declared. Use the reference variable, to invoke a method to find out whether the air conditioner is on and store the result in status.

Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off, and checking if the air conditioner is on or off. The following methods provide this behavior: turnOn and turnOff, setTemp, and isOn, which accepts no argument and returns a boolean indicating whether the air conditioner is on or off.  Assume there is a reference variable myAC to an object of this class, which has already been created. There is also a boolean variable status, which has already been declared. Use the reference variable, to invoke a method to find out whether the air conditioner is on and store the result in status.

LANGUAGE: JAVA

CHALLENGE:

Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off, and checking if the air conditioner is on or off. The following methods provide this behavior: turnOn and turnOff, setTemp, and isOn, which accepts no argument and returns a boolean indicating whether the air conditioner is on or off.

Assume there is a reference variable myAC to an object of this class, which has already been created. There is also a boolean variable status, which has already been declared. Use the reference variable, to invoke a method to find out whether the air conditioner is on and store the result in status.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level