Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class Main1{
  4.  
  5.     public static void main(String[] args) {
  6.         System.out.println("What grade did you obtain? ");
  7.         Scanner s = new Scanner(System.in);
  8.         String grade = s.next();
  9.         switch (grade)
  10.         {
  11.             case "A":
  12.                 System.out.println("You rock!");
  13.                 break;
  14.             case "B":
  15.                 System.out.println("Could be better");
  16.                 break;
  17.             case "C":
  18.                 System.out.println("You should practice more ");
  19.                 break;
  20.             case "D":
  21.                 System.out.println("You failed! ");
  22.                 break;
  23.             default:
  24.                 System.out.println("This ain't a grade! ");
  25.                 break;
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement