Module 5 - Employee Inheritance Lab

 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.

  1. 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 PrintEmployeeInformation() of the Employee class to also print the employee's gross pay for the pay period.

  2. 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:

  1. Java class files

  2. Screenshot of the Console with the code executing

 

COSC-1437 / ITSE-2457 Computer Science Dept. - Author: Dr. Kevin Roark