The Hospital class is being introduced to manage all patients more effectively. This class will serve as the central management for patient operations, including adding and removing patients.
The Hospital class will maintain a list of Patient instances, allowing centralized management.
Methods such as addPatient() and removePatient() will be encapsulated within the Hospital class, enhancing code modularity and reducing redundancy.
This change will allow easier extension in the future, for example, adding functionalities like finding patients by name or keeping track of hospital capacity.
Tasks:
Create the Hospital class with a List to store all patients.
Implement addPatient() and `removePatient()' methods inside the Hospital class.
Update existing functionality to utilize the Hospital class for patient management.
Description:
The Hospital class is being introduced to manage all patients more effectively. This class will serve as the central management for patient operations, including adding and removing patients.
addPatient()
andremovePatient()
will be encapsulated within the Hospital class, enhancing code modularity and reducing redundancy.Tasks: Create the Hospital class with a List to store all patients.
addPatient()
and `removePatient()' methods inside the Hospital class.