-
Notifications
You must be signed in to change notification settings - Fork 0
/
EmployeeManager.java
44 lines (33 loc) · 1.36 KB
/
EmployeeManager.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
public class EmployeeManager extends EmployeePerson {
private int numManaged; // Number of staff managed
// ***********************************************************************
// Default constructor
public EmployeeManager() {
numManaged = 0;
}
// ***********************************************************************
// Constructor with parameters
public EmployeeManager(int nManaged) {
numManaged = nManaged;
}
// ***********************************************************************
// Get the number of people managed
public int getNumManaged() {
return numManaged;
}
// ***********************************************************************
@Override
public void printInfo() {
System.out.println("Name: " + fullName + ", Department: " +
departmentCode + ", Birthday: " + birthday +
", Salary: " + annualSalary +
", Staff managed: " + getNumManaged());
}
// ***********************************************************************
// The annual bonus for a manager is 10% of the annual salary.
@Override
public int getAnnualBonus() {
return (int)(annualSalary * 0.10);
}
// ***********************************************************************
}