You are provided with a driver file called FactoryEmployees. The code in this file is complete, with the exception of a method for loading the array of employees from a data file. You must provide the...

1 answer below »
You are provided with a driver file called FactoryEmployees. The code in this file is complete, with the exception of a method for loading the array of employees from a data file. You must provide the code for this but no other code in the file may be changed. The Class FactoryEmployees performs tasks that allows the people in the human resources department of the factory to search the employee records to answer specific questions such as is there an employee with the first name John, or is there an employee with the last name Anderson, or which employees work third shift or who are the supervisors. All of the code that contains this functionality is already written in the FactoryEmployees class and must not be changed. Your task is to supply the super class and sub classes of the different employee types that will function with the executable program file FactoryEmloyee.java. You should use the code in the FactoryEmployee.java file to give you hints about parameter lists for the methods of the various function. The FactoryEmployees class requires four other classes to run: the Employee class, ProductionWorker class, Shift supervisor class and TeamLeader class. Pay attention to which class inherits which class. Your main tasks (besides loading the data to file as indicated above) will be to implement the following four classes. Pay strict attention to the data types in the 2 constructors. You must assume all setters and getters are required in the project although they might not be used in the FactoryEmployees class. The description for these classes are as follows: 1. Employee will serve as the super class for ProductionWorker and Supervisor. Employee contains the following instances variables: i. First name: String ii. Last name: String iii.Employee ID: String iv.Hire date: String 2. ProductionWorker: This class will extend the Employee class and will have additional fields to hold the following: i. Shift (an integer indicating shift 1, 2, or 3) ii. Hourly pay rate ( a double indicating hourly wage earned) 3. TeamLeader: This class will extend the ProductionWorker class and will have the additional fields to hold the following i. Bonus rate ii. Required number of training hours (double) iii.Hour of training achieved (double) 4. ShiftSupervisor: This class will extend the Employee class and will have the additional fields to hold the following: i. Shift: int ii. Annual salary: double iii.Bonus rate: double The class FactoryEmployees has the following functionality which should not be changed. • Stores employee record in a single array of the class Employee. • Allows search on first name, last name, position, and shift. • Allows searches to be repeated until the user indicates they want to quit the program. • Displays the result of a search in a neatly formatted fashion. • Prints out an entire list of all employees grouped by position, starting with supervisors, team leaders and then production workers. • Searches should be case insensitive and will require that you have methods in the Employee super Class with the following headers. You may not change the argument list or return type. • public boolean isSameFirstName(String n) • public boolean isSameLastName(String n) 3 There is only one place where code can be added to the FactoryEmployees class for the base problem: to implement the method loadFromFile. You may add additional code for extra credit of adding a new employee to the file. The data file has the following field structure, each record depending on the type of employee. Employee number will tell you which type employee the person is. For Production worker: • Employee number: The first two positions of employ number contains the employee type: PW for production worker, TL for TeamLeader and SU for shift Supervisor. • First name, • Last name, • Hire date, • Shift – there are four shifts, 1,2,3,4 • Hourly wage For Team leader (extends production worker) In addition to the production worker attributes • Bonus rate • Training hours required • Training hours received. For the supervisor: • Employee number: The first two positions of sequence code for employee type: PW for production worker, TL for TeamLeader and SU for shift Supervisor. • First name, • Last name, • Hire date, • Shift – there are four shift, 1,2,3,4 • Annual salary • Bonus rate All work must be submitted to Moodle by midnight on the due date. Your program will be evaluated on the criteria listed on the next page. I provide this so that you know what is expected in your implementation. The list of criteria contains items that you will earn points for and also several that will cause the loss of points earned elsewhere. To earn full credit, you must meet all criteria. Use this as a check list to check your solution before you submit it.
Answered Same DayNov 06, 2021

Answer To: You are provided with a driver file called FactoryEmployees. The code in this file is complete, with...

Shivani answered on Nov 09 2021
143 Votes
// Java class Employee
// Purpose: This file contains definition of the class Employee.
//             This
class serves as the Superclass for types of the employees in the system.
// Author:
// Date: 09-11-2020
public class Employee
{
    // private data members
    private String first_name;
    private String last_name;
    private String employee_id; // format: XXX-L where X is a number 0-9 and L is a letter from A-M
    private String hire_date;
    // public methods
    /**
    * Default constructor.
    * This constructor sets the name, employee id and hire date for an employee
    * @param fname The employee's first name
    * @param lname The employee's last name
    * @param id The employee's ID
    * @param hiredate The date the employee was hired
    */
    public Employee(String fname, String lname, String id, String hiredate)
    {
        this.first_name = new String(fname);
        this.last_name = new String(lname);
        this.employee_id = new...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here