Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can anyone help me with this Problem: Create a class called RoomOccupancy that can be used to record the number of people in the rooms
Can anyone help me with this
Problem: Create a class called 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 . roomCharges-the charge for the nightly occupancy of the room, in dollars. The class has the following methods: addOnToRoom adds a person to the room and increases the value of totalNumber removeOneFromRoom 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 - removes a person from the r oom, ensuring that numberlnRoom In addition, the usual methods will be included, as usual: .At least TWO constructors - a defaulto argument constructor and an overloaded . . constructor The accessor and mutator methods ( getters and setters). The toString' method. The 'equals method ( use the model used in the 'Person' class) The fina The 'copy constructor lize' method Write a client/test program to ex ercise the RoomOccupa ncy classStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started