fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. Scanner sc = new Scanner (System.in);
  13. System.out.println("Please enter your grade");
  14. int score = sc.nextInt();
  15. if (score<=100 && score >=85)
  16. System.out.println("A");
  17. if (score < 85 && score >=75)
  18. System.out.println("B");
  19. if (score < 75 && score >=60)
  20. System.out.println("C");
  21. if (score < 60)
  22. System.out.println("D");
  23. }
  24. }
Success #stdin #stdout 0.18s 56576KB
stdin
45
stdout
Please enter your grade
D