subject

(Hospital Class) Write a c++ class called 'Hospital' with Data Members: hospital name -string type- //store the name of the hospital Number of beds - integer type- //store number of beds in the hospital number of patient - integer type- // number of patients, consider each patient need one bed, if the hospital has 15 beds then no more than 15 patients Member Functions: Hospital(name, beds, patients) // Constructor to initilize data members addPatient() //to add one patient to number of patients currently in the hospital, just increment number of patient by 1 removePatient() //to remove one patient from number of patients currently in the hospital, just subtract one from number of patients displayInfo() // which just show information about the hospital: hospital name, number of beds, number of patients. Create a program that creates at least three Hospital objects or array of Hospital objects and tests the member functions of class Hospital. Note:- 1- when you add a patient it should not exceed the number of beds. If so, display an error message indicating that the hospital is full. 2- number of beds and number of patients should not be negative, if so, display and error message and set it to 0. 3- when you remove a patient and there is no patient, display an error message.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 04:31
Type the correct answer in the box. spell all words correctly. the managing director of a company sends a christmas greeting to all his employees through the company email. which type of network does he use? he uses an
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
Answers: 1
question
Computers and Technology, 24.06.2019 21:00
How does a vaccine prevent sickness and individual?
Answers: 2
You know the right answer?
(Hospital Class) Write a c++ class called 'Hospital' with Data Members: hospital name -string type-...
Questions
Questions on the website: 13722360