Develop a simple Payroll application for a company, there are three kinds of employees in the system: salaried employee, hourly employee, and commissioned employee. The system should take input as an array containing employee objects, calculate salary polymorphically (according to employee object), and generates report. In the SalariedEmp, salary is the salary – (salary * taxRate). In HourlyEmp, salary is (hours*hourlyRate) – (hours * hourlyRate * taxRate). In CommEmp, salary is (sales * commRate) – (sales * commRate * taxRate). Write a main() program to test the employee classes by creating array of pointer (size 3). Each pointer should be dynamically allocated to SalariedEmp, HourlyEmp and CommEmp respectively. Then, displaying the data (name and salary) using public method.
السؤال
ليلى سمور
Develop a simple Payroll application for a company, there are three kinds of employees in the system: salaried employee, hourly employee, and commissioned employee. The system should take input as an array containing employee objects, calculate salary polymorphically (according to employee object), and generates report. In the SalariedEmp, salary is the salary – (salary * taxRate). In HourlyEmp, salary is (hours*hourlyRate) – (hours * hourlyRate * taxRate). In CommEmp, salary is (sales * commRate) – (sales * commRate * taxRate). Write a main() program to test the employee classes by creating array of pointer (size 3). Each pointer should be dynamically allocated to SalariedEmp, HourlyEmp and CommEmp respectively. Then, displaying the data (name and salary) using public method.
رابط هذا التعليق
شارك على الشبكات الإجتماعية
2 أجوبة على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.