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, 22.06.2019 19:00
Which parts of a presentation should be the most general? a. introduction and conclusion b. introduction and outline c. outline and conclusion d. outline and body
Answers: 1
question
Computers and Technology, 22.06.2019 20:30
In this lab, you complete a prewritten c program that calculates an employee’s productivity bonus and prints the employee’s name and bonus. bonuses are calculated based on an employee’s productivity score as shown below. a productivity score is calculated by first dividing an employee’s transactions dollar value by the number of transactions and then dividing the result by the number of shifts worked.
Answers: 3
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
After you clean an engine with hot water spray, it seems to stall; when it doesn't stall, it's idling noisily. technician a says to check for loose bolts on the flex plate near the torque converter. technician b says to wipe down the spark plug wires and the distributor cap. who is correct? a. technician a b. both technicians a and b c. technician b
Answers: 1
You know the right answer?
(Hospital Class) Write a c++ class called 'Hospital' with Data Members: hospital name -string type-...
Questions
question
History, 23.08.2019 13:50