Question: Manager class JAVA Implement a subclass of Employee, called Manager. A Manager ID number ranges from 2001 to 3000. A manager also has a group

Manager class JAVA

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.

class Employee1 { private String name; private int Id; private int age; private double salary; private String title; public Employee1(String tName, int tId, int tAge, double tSalary, String tTitle) { //super(); name = tName; Id = tId; age = tAge; salary = tSalary; title = tTitle; } public String getName() { return name; } public int getId() { return Id; } public int getAge() { return age; } public double getSalary() { return salary; } public String getTitle() { return title; } public void setName(String tName) { name = tName; } public void setId(int tId) { Id = tId; } public void setAge(int tAge) { age = tAge; } public void setSalary(double tSalary) { salary = tSalary; } public void setTitle(String tTitle) { title = tTitle; } public void changeSalary(double percentage) { salary=salary *(1+percentage/100); } public String toString() { return "Employee [name=" + name + ", Id=" + Id + ", age=" + age + ", salary=" + salary + ", title=" + title + "]"; } }

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!