-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdministrativeWorker.java
More file actions
40 lines (30 loc) · 1.11 KB
/
AdministrativeWorker.java
File metadata and controls
40 lines (30 loc) · 1.11 KB
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
package workers;
public class AdministrativeWorker extends Employee {
private String role;
private EmployeeType employeeType = EmployeeType.ADMINISTRATIVE;
public AdministrativeWorker(String id, String firstName, String lastName, String phoneNumber, String emailAddress,
Gender gender, double basicMonthlySalary, String role) {
super(id, firstName, lastName, phoneNumber, emailAddress, gender, basicMonthlySalary);
this.role = role;
this.employeeType = EmployeeType.ADMINISTRATIVE;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
@Override
public double calculateMonthlyIncome() {
return getBasicMonthlySalary();
}
@Override
public String toString() {
return super.toString() +", Employee Type: " + employeeType + ", Role: " + role;
}
@Override
public boolean equals(Object other) {
return (other instanceof AdministrativeWorker)
&& super.equals(other);
}
}