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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 9E: Write a program named SalespersonDemo that instantiates objects using classes named Real...
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,