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.  
  13. System.out.println("What classes do you have on A, B, C, and D Days?:\n");
  14. System.out.println("A");
  15. System.out.println("B");
  16. System.out.println("C");
  17. System.out.println("D");
  18.  
  19. Scanner kbReader = new Scanner(System.in);
  20. String choice = kbReader.nextLine();
  21. char ch = choice.charAt(0);
  22.  
  23. System.out.println("");
  24.  
  25. switch(ch)
  26. {
  27. case'A'://A day
  28. case'a':
  29. System.out.println("You have AP Seminar, Intro to Java, World History Honors, Band, Geometry Honors, and Spanish 2 on A days");
  30. break;
  31. case'B'://B day
  32. case'b':
  33. System.out.println("You have Biology Honors, AP Seminar, Intro to Java, Gym, Band, and Geometry on B days");
  34. break;
  35. case'C'://C day case'c':
  36. System.out.println("You have World History Honors, Biology Honors, AP Seminar, Spanish 2, Gym, and Band on C days");
  37. break;
  38. case'D'://D day
  39. case'd':
  40. System.out.println("You have Intro to Java, World History Honors, Biology Honors, Geometry Honors, Spanish 2, and Gym on D days");
  41. break;
  42.  
  43. }
  44.  
  45. }
  46. }
Success #stdin #stdout 0.14s 56568KB
stdin
A
stdout
What classes do you have on A, B, C, and D Days?:

A
B
C
D

You have AP Seminar, Intro to Java, World History Honors, Band, Geometry Honors, and Spanish 2 on A days