Question: C++ language, i found this codes but no input 0.5 Tuesday, February 16, 2021 12:00 PM (Hospital Class) Write a c++ class and test the
C++ language, i found this codes but no input
0.5 Tuesday, February 16, 2021 12:00 PM (Hospital Class) Write a c++ class and test the 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 patientsMember 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 Create a program displayInfo() // which just show information about the hospital: hospital name, number of beds, number of patients. 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. ASSIGNMENT SUBMISSION
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
