-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoctor.java
More file actions
40 lines (32 loc) · 1.02 KB
/
Doctor.java
File metadata and controls
40 lines (32 loc) · 1.02 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
39
40
public class Doctor extends Staff {
private String SpecialMajor;
public Doctor(String FirstName, String LastName, int Id, int Age, Date BirthDate, char Gender, int Salary, String SpecialMajor) {
super(FirstName, LastName, Id, Age, BirthDate, Gender, Salary);
this.SpecialMajor = SpecialMajor;
}
public Doctor() {
this(null, null, 0, 0, null, ' ', 0, null);
}
public String getSpecialMajor() {
return SpecialMajor;
}
public void setSpecialMajor(String SpecialMajor) {
this.SpecialMajor = SpecialMajor;
}
@Override
public void NameOfClass() {
System.out.println(this.getClass().getSimpleName());
}
@Override
public double calcSalary(int workingHours) {
if (workingHours > getWORKING_HOURS()) {
return (workingHours * 20 * 100);
} else {
return getSalary();
}
}
@Override
public String toString() {
return super.toString() + "SpecialMajor: " + SpecialMajor;
}
}