Create a class RoomOccupancy that can be used to record the number of people in the rooms of a building. The class has the attributes

• numberInRoom—the number of people in a room
• totalNumber—the total number of people in all rooms as a static variable
The class has the following methods:
• addOneToRoom—adds a person to the room and increases the value of totalNumber
• removeOneFromRoom—removes a person from the room, ensuring that numberInRoom does not go below zero, and decreases the value of totalNumber as needed
• getNumber—returns the number of people in the room
• getTotal—a static method that returns the total number of people


See the code in RoomOccupancy.java.

Computer Science & Information Technology

You might also like to view...

Using any Web browser, look at some of the following Web sites and discover the wealth of information held there.

What will be an ideal response?

Computer Science & Information Technology

calck solves H = kA(T2 - T1) / X for k double calck (double H, double A, double T2, double T1, double X)

What will be an ideal response?

Computer Science & Information Technology

Where do you typically put a page break?

A) Group header B) Page footer C) Group footer D) Section footer

Computer Science & Information Technology

You can use formulas to analyze PivotTable data in a field by adding a calculated field.? ____________________

Answer the following statement true (T) or false (F)

Computer Science & Information Technology