1. An organization has two types of employees: regular and adhoc. Regular employees get a salary which is basic + DA + HRA where DA is 10% of basic and HRA is 30% of basic. Adhoc employees are daily wagers who get a salary which is equal to Number * Wage.
(i) Define the classes shown in the following class hierarchy diagram:
(ii) Define the constructors. When a regular employee is created, basic must be a parameter.
(iii) When adhoc employee is created wage must be a parameter.
(iv) Define the destructors.
(v) Define the member functions for each class. The member function days ( ) updates number of the Adhoc employee.
(vi) Write a test program to test the classes.
Comments
Leave a comment