Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java Programming

Authors: Joyce Farrell

9th edition

1337397075, 978-1337397070

More Books

Students also viewed these Programming questions

Question

Every real number is either a/an number or a/an_______ number.

Answered: 1 week ago

Question

If I called your former employers, what would they say about you?

Answered: 1 week ago