-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSeniorDeveloper.java
108 lines (102 loc) · 3.19 KB
/
SeniorDeveloper.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/**
* Write a description of class Seniordeveloper here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class SeniorDeveloper extends Developer
{
private int salary;
private String joiningDate;
private String staffRoomNumber;
private int contractPeriod;
private int advanceSalary;
private boolean appointed;
private boolean terminated;
public SeniorDeveloper(String platform, String interviewerName, int workingHours, int salary, int contractPeriod){
super(platform,interviewerName,workingHours);
this.salary = salary;
this.contractPeriod = contractPeriod;
this.joiningDate = "";
this.staffRoomNumber = "";
this.advanceSalary = 0;
this.appointed = false;
this.terminated = false;
}
public void setContractPeroid(int contractPeriod){
this.contractPeriod = contractPeriod;
}
public void setSalary(int salary){
this.salary = salary;
}
public int getContractPeroid(){
return contractPeriod;
}
public int getSalary(){
return salary;
}
public String getJoiningDate(){
return joiningDate;
}
public String getStaffRoomNumber(){
return staffRoomNumber;
}
public int getAdvanceSalary(){
return advanceSalary;
}
public boolean getAppointed(){
return appointed;
}
public boolean getTerminated(){
return terminated;
}
public void hireDeveloper(String developerName, String joiningDate, int advanceSalary, String staffRoomNumber){
if(appointed == true){
System.out.println("Developer is already hired.");
System.out.println("Developer Name ="+super.getDeveloperName());
System.out.println("Room Number:"+getStaffRoomNumber());
}
else{
super.setDeveloperName(developerName);
this.joiningDate = joiningDate;
this.staffRoomNumber = staffRoomNumber;
this.advanceSalary = advanceSalary;
appointed = true;
terminated = false;
System.out.println("The developer is hired");
}
}
public void termination()
{
if(terminated==true)
{
System.out.println("Developer is already terminated.");
System.out.println("You can hire new developer now.");
}
else
{
setDeveloperName(" ");
joiningDate=" ";
advanceSalary=0;
terminated=true;
appointed=false;
}
}
public void print()
{
System.out.println("Platform="+getPlatform());
System.out.println("Interviewer Name="+getInterviewerName());
System.out.println("Developer Salary="+getSalary());
}
public void display()
{
super.display();
if(appointed==true)
{
System.out.println("Staff Room Number= "+getStaffRoomNumber());
System.out.println("Join Date= "+getJoiningDate());
System.out.println("Advance Salary= "+getAdvanceSalary());
System.out.println("The Senior developer has been hired");
}
}
}