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
SalariedEmployee
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.
equals()
and toString()
.
Write a main class with a main method that demonstrates that the derived classes work correctly.