Guest User

Untitled

a guest
Nov 23rd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class readSalary {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. String name;
  7. int salary, meritPoints;
  8. String[] grade = {"A","B","C"};
  9. int terminator = 0;
  10. while (terminator == 0) {
  11. System.out.println("Enter Name n");
  12. name = sc.nextLine();
  13. System.out.println("Enter Salary n");
  14. salary = sc.nextInt();
  15. System.out.println("Enter Merit Points n");
  16. meritPoints = sc.nextInt();
  17.  
  18. if (salary > 600 && salary < 649) {
  19. if (meritPoints < 10) {
  20. System.out.println("Employee: "+name+" has a grade of: "+grade[2]);
  21. }
  22. else {
  23. System.out.println("Employee: "+name+" has a grade of: "+grade[1]);
  24. }
  25. }
  26. else if (salary > 700 && salary < 900) {
  27. if (meritPoints < 20) {
  28. System.out.println("Employee: "+name+" has a grade of: "+grade[1]);
  29. }
  30. else {
  31. System.out.println("Employee: "+name+" has a grade of: "+grade[0]);
  32. }
  33. }
  34.  
  35. System.out.println("Type 1 to Quit, or 0 to Continue n");
  36. terminator = sc.nextInt();
  37. if (terminator == 0) {
  38. terminator = 0;
  39. }
  40. else {
  41. terminator = 1;
  42. }
  43.  
  44. }
  45. sc.close();
  46. }
  47. }
Add Comment
Please, Sign In to add comment