by CodeChum Admin
Construct a class to represent an air conditioning (AC) unit containing the following attributes:
It should contain the following methods:
Input
The first input is an integer which will create an instance of an AC unit depending on the constructor used. This is specified below: 1 - construct an AC unit object via the default constructor (no input needed) 2 - construct an AC unit object via the overloaded constructor (a String for the brand followed by 1 (inverter type) or 0 (non-inverter type)) Then a number m is encountered which represents the number of operations that have to be invoked. This is then followed by an integer representing what operator to execute. The operators are specified below: 3 - calls power() 4 - calls thermostatUp() 5 - calls thermostatDown() 6 - calls temperatureUp() 7 - calls temperatureDown() 8 - calls getBrand() 9 - calls getType() 10 - calls getPower() 11 - calls getThermostat() 12 - calls getTemperature() 13 - calls display()
Output
For each of the getter methods that gets called, the values they return must be printed. And it goes without saying that the constructors and display() method produce output.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here