Suppose that you are going to create an object used to count the number of people in a room. We know that the number of people in the room can never be negative.
Create a RoomCounter class having three public methods:
• addPerson—adds one person to the room
• removePerson—removes one person from the room
• getCount —returns the number of people in the room
If removePerson would make the number of people less than zero, throw a NegativeCounterException.
See the code in RoomCounter.java.
Computer Science & Information Technology
You might also like to view...
Which of the following is mandatory?
A. Regulatory policy B. Advisory policy C. Informative policy D. Guidelines
Computer Science & Information Technology
Identify the HTML code to create form buttons to switch between the web view and page view.
A.
B. C. D.
Computer Science & Information Technology