ALGORITHM:
Step 1: Start the program.
Step 2: Declare the base class emp.
Step 3: Define and declare the function get() to get the employee details.
Step 4: Declare the derived class salary.
Step 5: Declare and define the function get1() to get the salary details.
Step 6: Define the function calculate() to find the net pay.
Step 7: Define the function display().
Step 8: Create the derived class object.
Step 9: Read the number of employees.
Step 10: Call the function get(),get1() and calculate() to each employees.
Step 11: Call the display().
Step 12: Stop the program.
PROGRAM:PAYROLL SYSTEM USING SINGLE INHERITANC
char name[ 20 ],des[ 20 ]; |
cout<< "Enter the employee number:" ; |
cout<< "Enter the employee name:" ; |
cout<< "Enter the designation:" ; |
cout<< "Enter the basic pay:" ; |
cout<< "Enter the Humen Resource Allowance:" ; |
cout<< "Enter the Dearness Allowance :" ; |
cout<< "Enter the Profitablity Fund:" ; |
cout<<eno<< "\t" <<name<< "\t" <<des<< "\t" <<bp<< "\t" <<hra<< |
"\t" <<da<< "\t" <<pf<< "\t" <<np<< "\n" ; |
cout<< "Enter the number of employee:" ; |
cout<< "\ne_no \t e_name\t des \t bp \t hra \t da \t pf \t np \n" ; |
|
Output:
Enter the Number of employee:1
Enter the employee No: 150
Enter the employee Name: ram
Enter the designation: Manager
Enter the basic pay: 5000
Enter the HR allowance: 1000
Enter the Dearness allowance: 500
Enter the profitability Fund: 300
E.No E.name des BP HRA DA PF NP
150 ram Manager 5000 1000 500 300 6200
0 Response for the "To write a program to find out the payroll system using single inheritance."
Post a Comment