Purpose : This assignment is designed work withtext files, string manipulation a
ID: 3610343 • Letter: P
Question
Purpose: This assignment is designed work withtext files, string manipulation and inheritance.
Assignment Description:
A Java program should be created to read an employee text file(Information.txt) and decide from the employeenumber and shift which department and shift the employee isassigned. A list of the employees and their informationshould be listed to the monitor as well as written to a text filenamed Department.txt.
Instructions:
Create a class namedEmployee including a constructor and the necessaryaccessor and mutator methods. The class should keep the followinginformation in fields:
o Employee Name
o Employee Number in the format NNN-X, where each N is a digitand 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 namedProductionWorker that inherits from theEmployee class. Include a constructor andthe necessary accessor and mutator methods. TheProductionWorker class should keep the followinginformation in fields:
o Shift Number which is an integer and can be one of thefollowing:
· 1 -represents Morning Shift
· 2 -represents Swing Shift
· 3 -represents Night Shift
o Hourly Pay Rate
Input: The input file will be namedInformation.txt. One record (line) will containthe employee name, employee number, hire date, shift number and payrate each separated by spaces. A sample text file is below.
JaneRivers 902-A 05/16/2001 1 16.25
Bob Cox 823-S06/21/1990 2 17.50
Ann Ramsey 715-A 02/12/19981 16.25
Joseph Chandler 723-P12/22/2000 3 14.35
Arnold Kennedy 133-S08/10/1999 2 18.20
Larry Huber 198-P02/12/2000 3 17.25
Annette Wilson 501-H04/04/1995 1 20.25
Robert Ferguson 674-H04/10/2002 2 16.50
Ava Gaines 434-H01/05/2000 3 15.65
Output: Output should consist of a listing ofthe employee name, employee number, employee's department, hiredate, shift name and pay rate This information should bedisplayed on the monitor as well as written to a text file namedDepartment.txt. The format for writing to themonitor could be as follows:
Jane Rivers 902-AAccounting 05/16/2001 Morning Shift16.25
BobCox 823-SShipping 06/21/1990 SwingShift 17.50
Ann Ramsey 715-A Accounting 02/12/1998 MorningShift 16.25
Joseph Chandler723-PProduction 12/22/2000 Night Shift 14.35
Arnold Kennedy 133-SShipping 08/10/1999 SwingShift 18.20
Larry Huber 198-PProduction 02/12/2000 Night Shift 17.25
Annette Wilson 501-H HumanResources 04/04/1995 Morning Shift 20.25
Robert Ferguson674-H HumanResources 04/10/2002 Swing Shift 16.50
Ava Gaines 434-P Production 01/05/2000 NightShift 15.65
Explanation / Answer
How would I go about putting the class Employee and the file readerinto the program? Should the file reader have another name insteadof employee like you have? And can you highlight the parts that ineed to put in myself? Thanks
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.