CS304 - Object Oriented Programming Solution Assignment No 2 Fall 2020

Assignment No 3 Fall 2020
Requirement:

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:

  1. Person
  2. Staff
  3. 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

  • Name
  • Age
  • Gender
  • Address
  • Phone
  • Default Constructor
  • Setter functions to set values of data members of this class.
  • Getter functions to get the values of data members of this class.
  • A function to save information of a person
  • A function to display  information of a person

Patient

  • Sickness
  • Prescription
  • Default Constructor
  • A function to save  information of a  Patient
  • A function to display information of a Patient.

Staff

  • Education
  • Salary
  • Default Constructor
  • A function to save information of a Staff.
  • A function to display information of a Staff.

 Solution Guidelines:

Ø  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:



Previous Post Next Post