Question: Objective In module 3 Module 3 - Lab - Employee, you created an Employee class. I would like you to create 2 sub - classes

Objective
In module 3
Module 3- Lab - Employee, you created an Employee class. I would like you
to create 2 sub-classes of an Employee for this Lab. The sub-classes will both inherit from
the Employee Class. The following two classes will need to be created. Please ensure
aggregated classes have copy constructors and they are used in the appropriate places.
Salary
Attributes:
Annual Salary (getters/setters)
Monthly Bonus (getters/setters)
Constructor
Constructor to populate all arguments
Additional Methods
Calculate Pay - In our fictitious company, our salaried employees are paid 2 times
per month (24 total paychecks per year). Calculate the amount the employee will
get paid before taxes. Be sure to include 1//2 of the monthly bonus in each check.
Override the PrintEmployeelnformation() of the Employee class to also print the
employee's gross pay for the pay period.
Hourly
Attributes:
Hourly rate (getters/setters)
Hours worked per week (getters/setters)- Remember to calculate overtime
(Overtime is time and a half for every hour over 40)
Constructor
Constructor to populate all arguments
Additional Methods
Calculate Pay - in our fictitious company, our hourly employees are paid every
week. Calculate the amount the employee will get paid before taxes for a week.
Please be aware of overtime pay.
Override the PrintEmployeeInformation() of the Employee class to also print the
employees gross pay for the week.
Driver Program
Create a Driver Program to demonstrate the use of each of the classes (Salary and Hourly).
For the Driver Program, you do not need to get any user input - simply invoke the needed
constructors and print the information for each type of employee.
Deliverables
Upload the following files in a zip folder that you have created:
Java class files
Screenshot of the Console with the code executing
Down below is the code of the Employee class mentioned from module 3
/**
*/
package Three;
/**
*/
public class Employee {
private String employeeID;
private String firstName;
private String lastName;
private Address employeeAddress;
private Benefit employeeBenefit;
public Employee(String employeeID, String firstName, String lastName, Benefit employeeBenefit, Address employeeAddress){
this.employeeID = employeeID;
this.firstName = firstName;
this.lastName = lastName;
this.employeeBenefit = employeeBenefit;
this.employeeAddress = employeeAddress;
}
public String printEmployeeInformation(){
return "***** Employee Information *****
"+ "Employee Details:
"+ firstName +""+ lastName +"("+ employeeID +")
"+ employeeAddress.printAddress()+
|"
"+ "Benefits:
"+ employeeBenefit.printBenefit();
{
}
Objective In module 3 Module 3 - Lab - Employee,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!