Write a C++ program for implementing the following
a. Create a class called Employee with Employee name, Designation and Basic Pay as data members.
b. Inherit a class called Allowance from Employee with HRA and DA as data members
c. Inherit a class called Deductions from Employee with PF and Income Tax as data members
d. Inherit class Salary from Allowance and Deductions which has Net pay as its data member.
Create an array of employees, calculate net pay for each employee and sort them (using operator overloading).
#include<iostream>
using namespace std;
class Employee{
private:
string name;
string designation;
int basic_pay;
pu
};
class Allowance: public Employee{
private:
double hra;
double da;
};
class Deductions: public Allowance{
private:
double net_pay;
};
int main(){
}
Comments
Leave a comment