Question: java ty (In other words, it will set A. Create a class Room Occupa S koomOccupancy that can be used to record the number of
ty (In other words, it will set A. Create a class Room Occupa S koomOccupancy that can be used to record the number of people in the rooms of a building. The class has the attributes niimberin Roomthe number of people in a room Total Number the total number of people in all building rooms room roomCapacity the maximum allowed number of people in the room The class has the following methods: Const Constructor method - sets number in Room, and roomCapacity ensuring that th numberInRoom should always be less than roomCapacity (In other words, its all values to zero and display an error message The number of people in that cannot exceed its capacity", if numberinRoom>roomCapacity) addOneToRoom-adds a person to the room ensuring that numberIn Room does exceed the roomCapacity, and increases the value of totalNumber. (The functio should display this error message "The number of people in that room cannot its capacity", if numberin Room>roomCapacity) removeOne From Room removes a person from the room, ensuring that numberin Room does not go below zero, and decreases the value of totalNumber as needed the function should display this error message "The room is already m if numberinRoom
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
