Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program is written in Java, any help would be greatly appreciated. We want you to create a class RoomPeople that can be used to

This program is written in Java, any help would be greatly appreciated.

image text in transcribed

We want you to create a class RoomPeople that can be used to record the number of people in the rooms of a building. The class has the attributes: numberlnRoom -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 removeOneF romRoom - removes a person from the room, ensuring that numberlnRoom does not go below zero, and decreases the value of totalNumber as needed get Number - returns the number of people in the room getTotal - a static method that returns the total number of people Please write a program to test the class RoomPeople. Expected results

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

Defi ne grievance and identify the stages in a grievance procedure.

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago