Source of EmployeeStaff.java


  1: //EmployeeStaff.java

  3: public class EmployeeStaff extends EmployeePerson
  4: {
  5:     private String managerName;

  7:     // ***********************************************************************

  9:     // Default constructor
 10:     public EmployeeStaff()
 11:     {
 12:         managerName = "";
 13:     }

 15:     // ***********************************************************************

 17:     // Constructor with parameters
 18:     public EmployeeStaff(String reportsTo)
 19:     {
 20:         managerName = reportsTo;
 21:     }

 23:     // ***********************************************************************

 25:     // Get the name of the manager

 27:     public String getManagerName()
 28:     {
 29:         return managerName;
 30:     }

 32:     // ***********************************************************************

 34:     @Override
 35:     public void printInfo()
 36:     {
 37:         System.out.println
 38:         (
 39:             "Name: " + fullName + ", Department: " +
 40:             departmentCode + ", Birthday: " + birthday +
 41:             ", Salary: " + annualSalary +
 42:             ", Manager: " + getManagerName()
 43:         );
 44:     }

 46:     // ***********************************************************************

 48:     // FIXME: Implement the getAnnualBonus method. A staff's annual bonus
 49:     //        is calculated as 7.5% of the employee's annual salary.

 51:     @Override
 52:     public int getAnnualBonus()
 53:     {
 54:         return 0;
 55:     }
 56: }