I just need help in this last part of the code JAVA.
Here are the instructions:
BTest
Implement a class called BusinessTest which includes the main program: BusinessTest
- Has three ArrayLists called employeeAL, managerAL and executiveAL of type Employee, Manager and Executive respectively.
- 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.)
- 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.
- 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.
- Once the results are read in assign each Manager in the managerAL to an Executive in a round robin fashion.
- Prompt the user to enter the companys profits and bonus percentage. Use this to set the total compensation for each Executive.
- 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:
- The total payroll for the business including bonuses.
- The attributes for each Executive, Manager and Employee as shown in the output file.
- For each Executive the direct report Managers as shown in the output file.
- For each Manager print out the direct report Employees as shown in the output file
- Read in the percent raise for the managers.
- 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
.........................................................................
the output should look like this.........
that is the input and the output i provided below
this is the whole program but i just need help with the btest part
The total payroll for the business is $1,864,530.60 Compensation Table Executives Name Title Guitierez ExecutiveStrat Silva ExecSW IDAge 3001 37 3119 Salary $167,854.00 $174,765.00 Total Comp $233,623.30 $240,534.30 Age 34 Managers Name Choi Taki Yem Rosendo Puig 38 Title Manager Eng ManagersW ManagerEE ManagerHR ManagerEE ID 2309 2379 2001 2009 2311 Salary $104,765.00 $134,765.00 $112,235.00 $81, 213.00 $144,111.00 32 36 42 ID 123 Age 21 44 33 Employees Name Aguilar Andres Nishi Agee Hernandez Jones Morales Nombrado Pena Sosa Soto Title Engineer Mechanic Engineer Programmer Engineer2 Electrice Architect Programmer Electrice Comp Tech Programmer 1234 1987 1308 129 239 29 Salary $62,345.00 $49,876.00 $76,432.00 $69,874.00 $82,545.00 $77,865.00 $111, 076.00 $72,876.00 $72,865.00 $57,654.00 $79,876.00 37 109 1119 27 1239 1959 1629 31 Reporting Structure Direct Reports To Executive Executive Guitierez has the following direct reports Choi 2309 Yem 2001 Puig 2311 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 Manager EE 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 1 T-Mobile LTE 10:04 AM 0 * 99% csc 300csudhspring2020.weebly.com Employee class (20) 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 (15) 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 Provide a mutator which adds an Employee (an input parameter reference) to the managedEmployees list. b. Provide an method called getManagedEmployees ListSize which returns the size of the managedEmployees list. c. Provide a method called getManagedEmployee with an input parameter I which returns a reference to the Employee at index I in the managedEmployees list. d. Override toString(). All you need to do is change the word employee to manager. No new variables here. Executive class (15) 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 set TotalComp with the company's 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 get TotalComp() 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. Business Test (30) Implement a class called Business Test which includes the main propram: Business Test The total payroll for the business is $1,864,530.60 Compensation Table Executives Name Title Guitierez ExecutiveStrat Silva ExecSW IDAge 3001 37 3119 Salary $167,854.00 $174,765.00 Total Comp $233,623.30 $240,534.30 Age 34 Managers Name Choi Taki Yem Rosendo Puig 38 Title Manager Eng ManagersW ManagerEE ManagerHR ManagerEE ID 2309 2379 2001 2009 2311 Salary $104,765.00 $134,765.00 $112,235.00 $81, 213.00 $144,111.00 32 36 42 ID 123 Age 21 44 33 Employees Name Aguilar Andres Nishi Agee Hernandez Jones Morales Nombrado Pena Sosa Soto Title Engineer Mechanic Engineer Programmer Engineer2 Electrice Architect Programmer Electrice Comp Tech Programmer 1234 1987 1308 129 239 29 Salary $62,345.00 $49,876.00 $76,432.00 $69,874.00 $82,545.00 $77,865.00 $111, 076.00 $72,876.00 $72,865.00 $57,654.00 $79,876.00 37 109 1119 27 1239 1959 1629 31 Reporting Structure Direct Reports To Executive Executive Guitierez has the following direct reports Choi 2309 Yem 2001 Puig 2311 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 Manager EE 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 1 T-Mobile LTE 10:04 AM 0 * 99% csc 300csudhspring2020.weebly.com Employee class (20) 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 (15) 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 Provide a mutator which adds an Employee (an input parameter reference) to the managedEmployees list. b. Provide an method called getManagedEmployees ListSize which returns the size of the managedEmployees list. c. Provide a method called getManagedEmployee with an input parameter I which returns a reference to the Employee at index I in the managedEmployees list. d. Override toString(). All you need to do is change the word employee to manager. No new variables here. Executive class (15) 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 set TotalComp with the company's 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 get TotalComp() 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. Business Test (30) Implement a class called Business Test which includes the main propram: Business Test