-
Notifications
You must be signed in to change notification settings - Fork 0
/
Employee1.java
50 lines (41 loc) · 999 Bytes
/
Employee1.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
public class Employee1 {
private String name;
private double salary;
public Employee1(String name, double salary) {
this.name = name;
this.salary = salary;
}
public Employee1() {
this.name = "";
this.salary = 25000.00;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
/**
*
* @param increase insert decimal value
*/
public void raiseSalary(double increase) {
if (increase < 1) {
increase += 1;
}
salary *= increase;
}
@Override
public String toString() {
return "Employee [name=" + name + ", salary=" + salary + "]";
}
public String getVacation() {
return "Employees need to wait 1 year to receive vacation!";
}
}