Answer the following questions with class definition (object) defined below: class Room { private String my_roomName; private
Fantastic news! We've Found the answer you've been seeking!
Question:
- Answer the following questions with class definition (object) defined below:
class Room {
private String my_roomName;
private int desiredTemp; // desired temperature setting
private int actualTemp; // actual temperature setting
Room( );
Room(String room_name);
public void set_desiredTemp (int newTemp) { // set the desired Temp }
public void set_actualTemp (int actTemp) { // set the actual Temp }
public int getDesiredTemp( ) { // returns the desired temperature setting }
public int getActualTemp( ) { // returns the actual temperature setting }
}
- What is the name of the class?
- Name all methods except for the constructors.
- How many class data declarations are there?
- getActualTemp ( ) method returns what data type?
- Construct an object data type named kitchen that has a room name of kitchen
- Write statement(s) that will set the desired temperature to 75 degrees for the kitchen.
- Write statement(s) that will display the room's (kitchen) desired temperature.
- Write statement(s) that will display the room's (kitchen) actual temperature.
- Write statement that will create 100 references for Room object.
Related Book For
Intermediate Accounting
ISBN: 978-0470161012
9th Canadian Edition, Volume 2
Authors: Donald E. Kieso, Jerry J. Weygandt, Terry D. Warfield.
Posted Date: