CSC 175 - Intermediate Programming

Dr. R. M. Siegfried

Assignment #18 - Creating a Set of Payroll Classe

Due Wednesday, April 10, 2024

Create an abstract class called Payroll . It will have the following properties:

In addition to default, conversion and copy constructors, it has accessors and mutators for all three properties, as well as method equals. It has two abstract methods: getPay() , which is weekly pay and toString() .

There are two derived classes, which you will also create:

HourlyEmployee has two properties: wageRate and hours (per week). Its version of getPay() returns the weekly pay and pays time and a half for over 40 hours per week.

SalariedEmployee has one property, the annual salary. Its version of getPay() returns weekly pay which is 1/52 of annual salary.

Both derived classes need their own version of equals() and toString() .

Write a main class with a main method that demonstrates that the derived classes work correctly.

[Back to the Assignments List]