Question: Urgent HELP i just need help with the last part ( BusinessTest only ) java Employee class Implement a class Employee such that a member

Urgent HELP i just need help with the last part (BusinessTest only ) java

Employee class

Implement a class Employee such that a member of Employee has instance variables for name (String with no blanks), an ID number (int), an age (int), a salary(double), and a title (String with no blanks). An Employee ID has a value of 1 to 2000.

Include an accessor and mutator for each field value.

Include a toString method that prints out all the attributes of the employee.

Include a method changeSalary which accepts a percentage for change as a double and changes a salary with a double argument which is the percent increase or decrease. i.e.

The new salary is the current salary time (1.0 + (percent/100.0)).

Manager class

Implement a subclass of Employee, called Manager. A Manager ID number ranges from 2001 to 3000. A manager also has a group of employees that he/she supervises found in an ArrayList called managedEmployees. For managedEmployees

  1. Provide a mutator which adds an Employee (an input parameter reference) to the managedEmployees list.
  2. Provide an method called getManagedEmployeesListSize which returns the size of the managedEmployees list.
  3. Provide a method called getManagedEmployee with an input parameter I which returns a reference to the Employee at index I in the managedEmployees list.
  4. Override toString(). All you need to do is change the word employee to manager. No new variables here.

Executive class

Implement a subclass called Executive. Executive extends Manager, but an Executive only supervises an Employee who is a manager An Executive ID number ranges from 3001 to 3500.

Create an additional instance variable of type double called totalComp for an Executive which may be initialized to 0.0.

Add a mutator method called setTotalComp with the companys profits and the bonus percentage as input values, which calculates and sets the total compensation of salary plus bonus as a double. An executive gets a bonus at the end of each year equal to a percentage of company profits.

Also include a getTotalComp() method which returns the totalComp. Modify the toString() method to include the totalComp.

Override toString to include the totalComp for the Executive. Also change the word in the printout from manager to executive.

BusinessTest

Implement a class called BusinessTest which includes the main program: BusinessTest

  1. Has three ArrayLists called employeeAL, managerAL and executiveAL of type Employee, Manager and Executive respectively.
  2. Reads in the attributes of each employee from the file whose name you read in, in the order previously described. (In the Programs/Lesson 2/Homework tab for this lesson you will find the file emplist.txt which you can use.)
  3. As each employees attributes are read in the appropriate object is created based on the ID of the person. The object reference is then added to the end of the appropriate ArrayList.
  4. Once the results are read in assign each Employee in the employeeAL to a manager in a round robin fashion, adding a reference to the employee to the managedEmployees ArrayList for the appropriate Manager.
  5. Once the results are read in assign each Manager in the managerAL to an Executive in a round robin fashion.
  6. Prompt the user to enter the companys profits and bonus percentage. Use this to set the total compensation for each Executive.
  7. Create an output file and print all of the following to the output file whose name you read in. (See outemp.txt which is included in the Programs/Lesson 2/Homework tab.) The outputs are based on the interactive inputs shown below. Print to the output file:
    1. The total payroll for the business including bonuses.
    2. The attributes for each Executive, Manager and Employee as shown in the output file.
    3. For each Executive the direct report Managers as shown in the output file.
    4. For each Manager print out the direct report Employees as shown in the output file
  8. Read in the percent raise for the managers.
  9. For each manager raise the salary and then use toString to print out the new attributes (only the salary has changed) for each manager.

Interactive input on which the output file is based.

Please enter the name of the input file with employee name and data:

emplist.txt

Please enter the total company profit for the year: $876924

Please enter the executive bonus percentage for the year correct to 1 decimal place: 7.5

Please enter the name of the output file: outemp.txt

Please enter the salary change for a Manager as a percentage: 3.5

emplist.txt

Aguilar Engineer 123 21 62345 Andres Mechanic 1234 44 49876 Nishi Engineer 1987 33 76432 Agee Programmer 1308 25 69874 Choi ManagerEng 2309 34 104765 Guitierez ExecutiveStrat 3001 37 167854 Hernandez Engineer2 129 26 82545 Jones ElectricE 239 29 77865 Morales Architect 109 37 111076 Nombrado Programmer 1119 27 72876 Pena ElectricE 1239 24 72865 Sosa CompTech 1959 31 57654 Soto Programmer 1629 33 79876 Taki ManagerSW 2379 38 134765 Yem ManagerEE 2001 32 112235 Rosendo ManagerHR 2009 36 81213 Puig ManagerEE 2311 42 144111 Silva ExecSW 3119 42 174765

outemp.txt (the output)

The total payroll for the business is $1,864,530.60 Compensation Table Executives Name Title ID Age Salary Total Comp Guitierez ExecutiveStrat 3001 37 $167,854.00 $233,623.30 Silva ExecSW 3119 42 $174,765.00 $240,534.30 Managers Name Title ID Age Salary Choi ManagerEng 2309 34 $104,765.00 Taki ManagerSW 2379 38 $134,765.00 Yem ManagerEE 2001 32 $112,235.00 Rosendo ManagerHR 2009 36 $81,213.00 Puig ManagerEE 2311 42 $144,111.00 Employees Name Title ID Age Salary Aguilar Engineer 123 21 $62,345.00 Andres Mechanic 1234 44 $49,876.00 Nishi Engineer 1987 33 $76,432.00 Agee Programmer 1308 25 $69,874.00 Hernandez Engineer2 129 26 $82,545.00 Jones ElectricE 239 29 $77,865.00 Morales Architect 109 37 $111,076.00 Nombrado Programmer 1119 27 $72,876.00 Pena ElectricE 1239 24 $72,865.00 Sosa CompTech 1959 31 $57,654.00 Soto Programmer 1629 33 $79,876.00 Reporting Structure Direct Reports To Executive Executive Guitierez has the following direct reports Choi 2309 Yem 2001 Puig 2311 Executive Silva has the following direct reports Taki 2379 Rosendo 2009 Direct Reports To Managers Manager Choi has the following direct reports Aguilar 123 Jones 239 Soto 1629 Manager Taki has the following direct reports Andres 1234 Morales 109 Manager Yem has the following direct reports Nishi 1987 Nombrado 1119 Manager Rosendo has the following direct reports Agee 1308 Pena 1239 Manager Puig has the following direct reports Hernandez 129 Sosa 1959 The manager name and title are Choi ManagerEng The manager ID is 2309 The manager age is 34 The manager salary is 108431.78 The manager name and title are Taki ManagerSW The manager ID is 2379 The manager age is 38 The manager salary is 139481.78 The manager name and title are Yem ManagerEE The manager ID is 2001 The manager age is 32 The manager salary is 116163.22 The manager name and title are Rosendo ManagerHR The manager ID is 2009 The manager age is 36 The manager salary is 84055.45 The manager name and title are Puig ManagerEE The manager ID is 2311 The manager age is 42 The manager salary is 149154.88

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!