Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 class

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions