Consider the following class hierarchy of preschool teachers of ABC school, to answer the
questions from i to iv.
full time teachers
part time teachers
All Preschool teachers have a teacher ID, name, age and Highest qualification. A full time
teacher has a fixed monthly salary. He/She has to necessarily contribute to the
EPF(Employee Provident Fund) and a monthly fee for the sports club, which is deducted
from his/her monthly salary. A part time teacher does not contribute to the EPF or to the
Sports club and He/She is paid a daily salary.
Piyal is a Full time teacher and Amara is a Part time teacher assigned to the school.
i. Identify appropriate data members for the base and derived classes according to
the description given above.
ii. Declare the base class using C++ coding.
iii. Implementing a function named print_details() in both the derived classes,
declare the derived classes using C++ coding. The function must be
implemented so that it demonstrates polymorphism.
iv. Write C++ coding for the following on the main function
a. Assuming values for the data members, create an instance (Piyal)
of the class Full time teacher and assign values to it.
b. Assuming values for the data members, create an instance (Amara)
of the class Part time teacher and assign values to it.
c. Display the details of Piyal and Amara by calling the function
print_details() as appropriate.