Question: This program represents a simple payroll system, which could hypothetically be used by a company to maintain information on their employees, departments, paychecks, etc. For
This program represents a simple payroll system, which could hypothetically be used by a company to maintain information on their employees, departments, paychecks, etc. For phase 1, we are just going to implement several classes, but we are not going to implement a user interface. I am providing you with code for the PayrollSystem_Phase1 class, which is the class that has the main method. Important: All the classes that you implement are to provide a constructor with enough parameters to initialize all instance variables and, unless specified, all classes also have to provide a copy constructor. Additionally, all classes need to provide a getter and a setter method for every instance variable, as well as the toString method, which returns a String with the value of all instance variables including labels. Include javadoc comments for all the classes, constructors, and methods in the project.
Employee This is an abstract class; it represents an employee in the company.
Private Instance Variables: employeeID of type int firstName of type String lastName of type String listOfPaychecks of type ArrayList
Notes: The toString method needs to iterate through the list of paychecks and include their information in the returned string.
HourlyEmployee - This class extends the Employee class. It represents an employee that gets paid by the hour.
Private instance variables: hourlyRate of type double periodHours of type double
SalariedEmployee This class extends the Employee class. It represents an employee that gets paid a salary. Private instance variable: annualSalary of type double Manager This class extends the SalariedEmployee class. It represents a departments manager.
Private instance variables: bonus of type double Paycheck This class represents a single paycheck that an employee receives for a pay period.
Private instance variables: employeeID of type int periodBeginDate of type String periodEndDate of type String grossAmount of type double taxAmount of type double bonusAmount of type double netAmount of type double
Department This class represents a department within the company.
Private instance variables: departmentID of type int departmentName of type String departmentManager of type Manager listOfEmployees of type ArrayList
Notes: The toString method needs to iterate through the list of employees and include their information in the returned string.
Company This class represents the company that is using this system to maintain their information.
Private instance variables: companyName of type String listOfdepartments of type ArrayList
Notes: The toString method needs to iterate through the list of departments and include their information in the returned string. This class does not have a copy constructor.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
