import java.util.*; class PayRise { public static void main(String[]args) { // variables int empID; char grade; double salary; double rise = 0; double newSalary = 0; Scanner sc = new Scanner(System.in); // constant data final double PAYRISE = 0.05; //pay rise for snr empl and >12000 of junior. final double PAYRISE_JNR = 0.07; // pay rise for junior first 12000 final double CUTOFF = 12000; // rate for sales <= quota //Input employee ID and sales System.out.print("\nEnter employee number : > "); empID= sc.nextInt(); System.out.print("\nEnter employee " + empID + " Grade (S = Senior, J = Junior) > "); grade = sc.next().charAt(0) ; System.out.print("\nEnter employee " + empID + " present salary > "); salary = sc.nextInt(); //Calculate pay rise if ((grade == 'S')||(grade == 's')) { rise = salary * PAYRISE; newSalary = salary + rise; }else if ((grade == 'J')||(grade == 'j')) { if(salary >= 12000){ rise = (CUTOFF * PAYRISE_JNR)+((salary - CUTOFF)*PAYRISE); }else{ rise = salary * PAYRISE_JNR; } newSalary = salary+rise; }else{ System.out.println("Invalid code"); } System.out.print("\nPay rise due to employee:"+empID+" is "+rise +"euro"); System.out.print("\nNew Salary of employee:"+empID+" is "+newSalary +"euro"); }//end main }// end class