In a Hospital Management system,
presently all patients and staff information is being stored manually. Traditional
method to store and get the information is very cumbersome and time-consuming. To
search the information of specific patients or staff results in unnecessary
delay. Keeping in the view above scenario, you are required to write a C++
program that can display the information of any specific patient or the staff.
It will contain following three classes:
- Person
- Staff
- Patient
where a person should be the base
class and staff and person should be its derived classes.
You are required to use the concept of Polymorphism to generate the sample output. Consider following class table for above scenario.
Class |
Data
Members |
Member
Functions |
Person |
|
|
Patient |
|
|
Staff |
|
|
Ø
Create three classes:
Person as a base class and Patient and Staff as derived classes.
Ø
You have to create the
default constructor for each class.
Ø
You have to create the
setter and getter functions for each attribute of Person class.
Ø
You have to create
Save_Information function for each class as mentioned in the table.
Ø
You have to create
Display_Information function for each class as mentioned in the table.
Ø
You have to use concept of
Polymorphism to generate the sample output.
Sample Output: