-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDoctor.java
68 lines (55 loc) · 2.57 KB
/
Doctor.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
59
60
61
62
63
64
65
66
67
68
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.practic1;
/**
*
* @author basal
*/
public class Doctor extends Worker {
private String specialization;
private String rise; //Прибавка к зарплате (ковидная прибавка)
private int overWork; //Переработка в часах
//Construct
public Doctor(String specialization, String rise, int overWork, int salary, String workSchedule, int workHours, String jobName, String name, String birthDate, String country) {
super(salary, workSchedule, workHours, jobName, name, birthDate, country);
this.specialization = specialization;
this.rise = rise;
this.overWork = overWork;
}
public Doctor(String specialization, String rise, int overWork, int salary, String workSchedule, int workHours, String jobName, String name, String birthDate) {
super(salary, workSchedule, workHours, jobName, name, birthDate);
this.specialization = specialization;
this.rise = rise;
this.overWork = overWork;
}
public Doctor(String specialization, String rise, int overWork, int salary, String workSchedule, int workHours, String jobName, String name) {
super(salary, workSchedule, workHours, jobName, name);
this.specialization = specialization;
this.rise = rise;
this.overWork = overWork;
}
//Voids
public void overWork() {
if (overWork == 1 || overWork == 0) {
System.out.println("You've overworked " + overWork + " hour");
}
else {
System.out.println("You've overworked " + overWork + " hours");
}
}
public void extraPaid() {
System.out.println("You've been paid for your extrawork. You've earned ");
System.out.println(overWork*salary);
}
public void carePeople() {
System.out.println("You've treated a person");
}
@Override
public String toString() {
return "Doctor{" + "name=" + getName() + ", birthDate=" + getBirthDate() + ", country=" + getCountry() + "salary=" + getSalary() + ", workSchedule="
+ getWorkSchedule() + ", workHours=" + getWorkHours() + ", jobName=" + getJobName() + "specialization=" + specialization + ", rise=" + rise + ","
+ " overWork=" + overWork + '}';
}
}