Assignment Description: A Java program should be created to read an employee tex
ID: 3534965 • Letter: A
Question
Assignment Description:
A Java program should be created to read an employee text file (Information.txt) and
decide from the employee number and shift which department and shift the employee is
assigned. A list of the employees and their information should be listed to the monitor as
well as written to a text file named Department.txt.
Instructions:
Create a class named Employee including a constructor and the necessary accessor and
mutator methods. The class should keep the following information in fields:
o Employee Name
o Employee Number in the format X-NNN, where each N is a digit and X is a
letter which can be one of the following:
ï‚· H - represents Human Resources
ï‚· A - represents Accounting
ï‚· P - represents Production
ï‚· S - represents Shipping
o Hire Date
Next, write a class named ProductionWorker that inherits from the Employee class. Include
a constructor and the necessary accessor and mutator methods. The ProductionWorker class
should keep the following information in fields:
o Shift Number which is an integer and can be one of the following:
ï‚· 1 - represents Morning Shift
ï‚· 2 - represents Swing Shift
ï‚· 3 - represents Night Shift
o Hourly Pay Rate
Input: The input file will be named Information.txt. One record (line) will contain the
employee name, employee number, hire date, shift number and pay rate each separated by
spaces. A sample text file is below.Jane Rivers, A-902, 05/16/2001, 1, 16.25
Bob Cox, S-823, 06/21/1990, 2, 17.50
Ann Ramsey, A-715, 02/12/1998, 1, 16.25
Joseph Chandler, P-723, 12/22/2000, 3, 14.35
Arnold Kennedy, S-133, 08/10/1999, 2, 18.20
Larry Huber, P-198, 02/12/2000, 3, 17.25
Annette Wilson, H-501, 04/04/1995, 1, 20.25
Robert Ferguson, H-674, 04/10/2002, 2, 16.50
Ava Gaines, H-434, 01/05/2000, 3, 15.65
Output: Output should consist of a listing of the employee name, employee number,
employee's department, hire date, shift name and pay rate This information should be
displayed on the monitor as well as written to a text file named Department.txt. The format
for writing to the monitor could be as follows:
Jane Rivers A-902 Accounting 05/16/2001 Morning Shift 16.25
Bob Cox S-823 Shipping 06/21/1990 Swing Shift 17.50
Ann Ramsey A-715 Accounting 02/12/1998 Morning Shift 16.25
Joseph Chandler P-723 Production 12/22/2000 Night Shift 14.35
Arnold Kennedy S-133 Shipping 08/10/1999 Swing Shift 18.20
Larry Huber P-198 Production 02/12/2000 Night Shift 17.25
Annette Wilson H-501 Human Resources 04/04/1995 Morning Shift 20.25
Robert Ferguson H-674 Human Resources 04/10/2002 Swing Shift 16.50
Ava Gaines P-434 Production 01/05/2000 Night Shift 15.65
Explanation / Answer
Please find the links to code in comments
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.