Create a simple Employee class with name, department, and title.
Create an hourlyEmployee class (which inherits from the Employee class) for a basic payroll program to compute the net pay salary of hourly based employees. Your program should also find the average net pay for a small company. To define the class, include the appropriate data members, member functions, constructors, and access modifiers. For simplicity, use a constant tax rate of 30% to compute the tax amount. Employees that work over 40 hours will receive overtime pay of one and a half of their hourly rate for overtime hours worked. The output should display the name of each employee, hours worked, hourly rate, overtime pay, regular (gross) pay, tax amount, and net pay.
Create a salariedEmployee class (which inherits from the Employee class) which hold the annual salary of the employee. To define the class, include the appropriate data members, member functions, constructors, and access modifiers. Figure weekly pay by dividing the annual salary by 52. The output for the salaried employee should display the name, gross pay, tax amount (compute at 30%), and net pay.
Write a test program with an array of 6 payroll objects: 3 hourlyEmployee objects and 3 salariedEmployee objects. The data for the 6 objects should be “hard coded” into the program.
Write a Review
Leave a reply Cancel reply
Ask Your Question
We have verified professionals who are ready to answer your question.
Save Time and Money
We choose experts who can quickly answer your question and that suit your budget.
Get Your Answer
Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.