Advertisement
Guest User

Untitled

a guest
May 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. import javax.swing.JOptionPane;
  2. import java.util.Scanner;
  3. public class revision {
  4. public int score;
  5. public String HD = "HD";
  6. public String DI = "DI";
  7. public String CR = "CR";
  8. public String PA = "PA";
  9. public String NN = "NN";
  10.  
  11. public int getGrade() {
  12. System.out.println("enter your score.");
  13. Scanner percentage = new Scanner (System.in);
  14. return score = percentage.nextInt();
  15.  
  16. }
  17. {
  18.  
  19. if (score > 80 && score < 100)
  20. System.out.println(this.HD);
  21. else if (score >= 60 && score <= 79)
  22. System.out.println(this.DI);
  23. else if (score >= 50 && score <= 59)
  24. System.out.println(this.DI);
  25. else if (score >= 0 && score <= 49)
  26. System.out.println(this.NN);
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement