Question: URGENT plz help java Employee class (20) Implement a class Employee such that a member of Employee has instance variables for name (String with no

URGENT plz help java

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

  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 (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 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 (30)

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

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!