-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathITEmployee.java
More file actions
121 lines (104 loc) · 2.17 KB
/
ITEmployee.java
File metadata and controls
121 lines (104 loc) · 2.17 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
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
109
110
111
public class ITEmployee {
private int id; //Data Hiding
private String name; // Instance Var
private double salary;
private final int pf;
private final String companyName;
private String deptName;
private double bonus;
private String managerName;
private String designation;
private String phone;
private String email;
private String pinCode;
public ITEmployee() {
pf = 200;
companyName="TCS";
}
// Local Var
public ITEmployee(int id, String name, double salary){
//ITEmployee();
this(); // This will Default Cons
this.id = id + pf;
this.name = name;
this.salary = salary;
}
public int getId() {
return id;
}
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;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public double getBonus() {
return bonus;
}
public void setBonus(double bonus) {
this.bonus = bonus;
}
public String getManagerName() {
return managerName;
}
public void setManagerName(String managerName) {
this.managerName = managerName;
}
public String getDesignation() {
return designation;
}
public void setDesignation(String designation) {
this.designation = designation;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPinCode() {
return pinCode;
}
public void setPinCode(String pinCode) {
this.pinCode = pinCode;
}
public int getPf() {
return pf;
}
public String getCompanyName() {
return companyName;
}
public double calculateNetSalary(){
return calculateGrossSalary() - pf;
}
private double calculateGrossSalary(){
return salary + calculateHra() + calculateDa() + calculateTa();
}
private double calculateHra(){
return salary * 0.30;
}
private double calculateDa(){
return salary * 0.20;
}
private double calculateTa(){
return salary * 0.10;
}
}