-
Notifications
You must be signed in to change notification settings - Fork 0
/
TeamLeader.java
58 lines (47 loc) · 1.61 KB
/
TeamLeader.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import java.util.Date;
public class TeamLeader extends ProductionWorker {
private double monthlyBonus;
private int rtHours;//Required Training Hours
private int atHours;//Training Hours Attended
public TeamLeader() {
super();
}
public TeamLeader(String name, String number, Date hireDate, Adress adress,int shift, double hourlyPayRate, int hoursPerMonth,double monthlyBonus, int rtHours, int atHours) {
super(name, number, hireDate, adress, shift, hourlyPayRate, hoursPerMonth);
this.monthlyBonus=monthlyBonus;
this.rtHours=rtHours;
this.atHours=atHours;
}
@Override
public String toString() {
return "TeamLeader [monthlyBonus=" + monthlyBonus + ", rtHours=" + rtHours + ", atHours=" + atHours
+ ", hourlyPayRate=" + hourlyPayRate + ", hoursPerMonth=" + hoursPerMonth + ", name=" + name
+ ", number=" + number + ", hireDate=" + hireDate + ", adress=" + adress + ", getTotalSalary()="
+ getTotalSalary() + "]";
}
public double getTotalSalary() {
if(atHours>=rtHours) {
double bonusAch = (monthlyBonus*atHours)/rtHours; //bonus Achieved
return super.getTotalSalary() +bonusAch;
}
else return super.getTotalSalary();//no bonus case
}
public double getMonthlyBonus() {
return monthlyBonus;
}
public int getRtHours() {
return rtHours;
}
public int getAtHours() {
return atHours;
}
public void setMonthlyBonus(double monthlyBonus) {
this.monthlyBonus= monthlyBonus;
}
public void setRtHours(int rtHours) {
this.rtHours= rtHours;
}
public void setAtHours(int atHours) {
this.atHours= atHours;
}
}