-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmployee.java
59 lines (55 loc) · 1.72 KB
/
Employee.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
public class Employee {
String name;
double salary;
double workHours;
int hireYears;
Employee(String name,double salary,double workHours,int hireYears){
this.name=name;
this.salary=salary;
this.workHours=workHours;
this.hireYears=hireYears;
}
double tax(){
double taxs;
if (this.salary>1000){
taxs=this.salary*0.03;
return taxs;
}else{
return taxs=0;
}
}
double bonus(){
double bonuss;
double extrahours;
if (this.workHours>40){
extrahours= (this.workHours-40);
bonuss=extrahours*30;
return bonuss;
}else {
return bonuss=0;
}
} double raiseSalary(){
double raisee;
if (this.hireYears>2011){
raisee=this.salary*0.05;
return raisee;
}else if (this.hireYears>2001 && this.hireYears<2011){
raisee=this.salary*0.10;
}else{
raisee=this.salary*0.15;
return raisee;
}
return raisee;
} void addprint(){
System.out.println("Adı :"+this.name);
System.out.println("Maaşı :"+this.salary);
System.out.println("Çalışma Saati :"+this.workHours);
System.out.println("Başlangıç yılı :"+this.hireYears);
System.out.println("vergi :"+tax());
System.out.println("Bonus :"+bonus());
System.out.println("Bonus :"+bonus());
System.out.println("Maaş Artışı :"+raiseSalary());
System.out.println("Vergi ve Bonuslar ile birlikte Maaş :"+(this.salary-tax()+bonus()));
System.out.println(" Toplam Maaş :"+(this.salary-tax()+bonus()+raiseSalary()));
}
}