Question: Programming Assignment # 6 Employee Payroll Management E MPLOYEE C LASS C HANGES: 1 . Add unique identifier to Employee class: o Change ID to

Programming Assignment #6
Employee Payroll Management
E MPLOYEE C LASS C HANGES:
1. Add unique identifier to Employee class:
o Change ID to be 8-digit String that is an auto-generated UUID
2. Change Name instance variable to be First Name and Last Name as
separate variables
o Update constructors
o Add getters and setters for FirstName and LastName
o Update getName method to return FirstName LastName
3. Change Employee class to be abstract
o Add one abstract method double pay();
4. Remove print() method
5. Add toString, equals, and hashCode methods
N EW C LASSES:
1. Add Hourly Employee class that is a subclass of Employee
o Add instance variable Pay Rate as a double
o Add instance variable Number Hours Worked as a double
o Add these to the constructors and add getters and setters
2. Add Salary Employee class that is a subclass of Employee
o Add instance variable Annual Salary as a double
o Add this variable to the constructors and add getter and setter
3. Implement abstract method pay in each employee subclass to calculate and
return the employees weekly pay amount:
o HourlyEmployee = pay rate * number hours worked
o SalaryEmployee = annual salary / number weeks in year
R EQUIREMENTS:
All classes should have the following methods:
o Default constructor with no arguments
o Constructor with all fields
o Getters & Setters for all instance variables except no setId method
o toString, equals, and hashCode methods
Classes must be named Employee, HourlyEmployee, SalaryEmployee in the
unex.hr package
Demo class must be called EmployeeDemo in the unex.hw package
2024 Charles Harless
D EMO R EQUIREMENTS:
Write a demonstration program that will create multiple employees and store
them in an ArrayList.
Create multiple instances of each employee type and store in ArrayList
Print out all employees
Pay all employees and print out a list of employees and their pay.
Include the total payroll amount for the week.
Use NumberFormat to format the pay amount as currency.
T IPS & H INTS:
Store constants as static variables, such as number of weeks in year.
You do not need to do user input. You can just create objects in your demo.
Create at least 5 employees and make sure to store them in an ArrayList

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!