Create a class named Employee including a constructor and the necessary accessor andmutator methods. The class should keep the following information in fields: 1.         Employee Name Employee Number in the format NNN-X, where each N is a digit and X is aletter represents department, which can be one of the following: H - Human Resources · A - Accounting · P - Production · S - Shipping Example: 902-A = an employee from Accounting department Hire Date   Next, write a class named ProductionWorker that inherits from the Employee class. Includea constructor and the necessary accessor and mutator methods. The ProductionWorker classshould keep the following information in fields: 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 Hourly Pay Rate You are required to write an application that reads input of employees information from a text file (Information.txt) and decide from the employee number his/her department and the working shift the employee is assigned. A list of the employees and their information should be displayed onto console as well as written to a text file named Department.txt.   Input: The input file will be named Information.txt. One record (line) will contain theemployee name, employee number, hire date, shift number and pay rate each separated byspaces (a non-production worker should be identified via zero number for the shift number). A sample text file is below. Susan 902-A 05/16/2009 1 16.25 Alex 823-S 06/21/2000 2 17.50 Ahmad 788-H 12/1/2003 0 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 bedisplayed on the screen as well as written to a text file named Department.txt in the format shown below:   Name              Employee No  Department                 Hire Date         Shift Name      Pay Rate ------------------------------------------------------------------------------------------------------------------------------- Susan              902-A              Accounting                  05/16/2009      Morning Shift  RM16.25 Alex                 823-S              Shipping                      06/21/2000      Swing Shift      RM17.50         Ahmad                        788-H              Human Resource       12/1/2003

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Create a class named Employee including a constructor and the necessary accessor andmutator methods. The class should keep the following information in fields:
1.         Employee Name

  1. Employee Number in the format NNN-X, where each N is a digit and X is aletter represents department, which can be one of the following:
  • H - Human Resources
    · A - Accounting
    · P - Production
    · S - Shipping

Example: 902-A = an employee from Accounting department

  1. Hire Date

 

Next, write a class named ProductionWorker that inherits from the Employee class. Includea constructor and the necessary accessor and mutator methods. The ProductionWorker classshould keep the following information in fields:

  1. 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

  1. Hourly Pay Rate

You are required to write an application that reads input of employees information from a text file (Information.txt) and decide from the employee number his/her department and the working shift the employee is assigned. A list of the employees and their information should be displayed onto console as well as written to a text file named Department.txt.

 

Input: The input file will be named Information.txt. One record (line) will contain theemployee name, employee number, hire date, shift number and pay rate each separated byspaces (a non-production worker should be identified via zero number for the shift number). A sample text file is below.

Susan 902-A 05/16/2009 1 16.25
Alex 823-S 06/21/2000 2 17.50

Ahmad 788-H 12/1/2003 0

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 bedisplayed on the screen as well as written to a text file named Department.txt in the format shown below:

 

Name              Employee No  Department                 Hire Date         Shift Name      Pay Rate

-------------------------------------------------------------------------------------------------------------------------------

Susan              902-A              Accounting                  05/16/2009      Morning Shift  RM16.25

Alex                 823-S              Shipping                      06/21/2000      Swing Shift      RM17.50        

Ahmad                        788-H              Human Resource       12/1/2003

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education