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 kbReader = new Scanner(System.in);
  13. System.out.print("What is your grade?");
  14. int theGrade = kbReader.nextInt();
  15.  
  16. if (theGrade>=90)
  17. {
  18. System.out.println("You made an A.");
  19. }
  20. else if (theGrade>=80)
  21. {
  22. System.out.println("You made a B");
  23. }
  24. else if (theGrade>=70)
  25. {
  26. System.out.println("You made a C.");
  27. }
  28. else if (theGrade>=60)
  29. {
  30. System.out.println("You made a D.");
  31. }
  32. else
  33. {
  34. System.out.println("Sorry, you failed.");
  35. }
  36. }
  37. }
Success #stdin #stdout 0.17s 54508KB
stdin
34
stdout
What is your grade?Sorry, you failed.