Question
Create an abstract class Faculty with the fields name and ID. Provide a pure virtual function salary (). Derive a class Permanent Faculty from Faculty.
Create an abstract class Faculty with the fields name and ID. Provide a pure virtual function salary (). Derive a class Permanent Faculty from Faculty. The class has additional attributes years of service and basic pay. The salary of permanent faculty is computed as the sum of basic pay, medical allowance and house rent. Medical allowance is 10% of basic pay and house rent is 25% of the basic pay.
Derive another class visiting faculty from Faculty. The class has attributes per hour rate and number of hours taught. The salary of visiting faculty is computed by multiplying the per hour rate with the number of hours taught.
Write a program to declare two pointers of class Faculty. Create an object each of visiting and permanent faculty, as sign their addresses to pointers of base class, set the value of data members and call the salary function for each.
Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
Solution Code and output include include include using namespace std class faculty protected string ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started