Employee Salary Code - PDF
Employee Salary Code - PDF
Employee Salary Code - PDF
11 this.employeeId=employeeId;
12 }
14 return employeeId;
15 }
17 this.employeeName=employeeName;
18 }
20 return employeeName;
21 }
23 this.salary=salary;
24 }
26 return salary;
27 }
29 this.incrementPercentage=incrementPercentage;
30 }
32 return incrementPercentage;
33 }
35 this.employeeId=employeeId;
36 this.employeeName=employeeName;
37 this.salary=salary;
38 }
41 if(yearsOfExperience>=1&&yearsOfExperience<=5){
42 incrementPercentage=15;
43 }
44 else if(yearsOfExperience>=6&&yearsOfExperience<=10){
45 incrementPercentage=30;
46 }
47 else if(yearsOfExperience>=11&&yearsOfExperience<=15){
48 incrementPercentage=45;
49 }
50 }
52 double incrementedSalary=salary+((salary*(double)incrementPercentage)/100);
53 return incrementedSalary;
54 }
55 }
56
Main.java
1 import java.util.*;
9 try
10 {
12 int id=Integer.parseInt(read.nextLine());
14 String name=read.nextLine();
16 double salary=Double.parseDouble(read.nextLine());
18 int exp_year=Integer.parseInt(read.nextLine());
20 e.findIncrementPercentage(exp_year);
21
22 double incrementedSalary=e.calculateIncrementSalary();
24 }
25 catch(Exception e)
26 {
27 System.out.println(e);
28 }
29 }
30
31 }
32