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

  1. 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 }

}

  1. What is the name of the class?

  1. Name all methods except for the constructors.

  1. How many class data declarations are there?

  1. getActualTemp ( ) method returns what data type?

  1. Construct an object data type named kitchen that has a room name of kitchen

  1. Write statement(s) that will set the desired temperature to 75 degrees for the kitchen.

  1. Write statement(s) that will display the room's (kitchen) desired temperature.

  1. Write statement(s) that will display the room's (kitchen) actual temperature.

  1. Write statement that will create 100 references for Room object.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The name of the class is Room Methods excluding constructors setdesiredTemp setactualTemp getDesire... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!