Question
Within c++ Create a simple Employee class with name, department, and title. Create an hourlyEmployee class (which inherits from the Employee class) for a basic
Within c++ 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 salaried employee 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 salaried employees objects. The data for the 6 objects should be hard-coded into the program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started