Here are the directions: Write a switch statement that checks origLetter. If '’a'’ or '’A'’, print "Alpha". If '’b'’ or '’B'’, print "Beta". For any other character, print "Unknown". Use fall-through as appropriate. End with newline. Use JOption pane to get the origLetter from user.
My problem is that "Alpha", "Beta", and "Unknown" are all printing no matter the input.
import javax.swing.JOptionPane; public class week7assignmentq1 { public static void main(String [] args){ char alpha = 'a' & 'A'; char beta = 'b' & 'B'; String origLetterString; origLetterString=JOptionPane.showInputDialog("Enter a letter:"); switch (alpha){ case 'a': case 'A': System.out.println("Alpha"); break; } switch (beta){ case 'b': case 'B': System.out.println("Beta"); default: System.out.println("unknown"); break; } } }