DaysoftheWeek - case 4...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import javax.swing.JOptionPane; public class DaysoftheWeek { public static void main(String[] args) { String dayNumber; dayNumber = JOptionPane.showInputDialog("Enter a Number for the Day of the Week, 1,2,3,4,5,6,or 7."); switch(1%7) { case 1: JOptionPane.showMessageDialog(null,"Today is Sunday!"); break; case 2: JOptionPane.showMessageDialog(null,"Today is Monday!"); break; case 3: JOptionPane.showMessageDialog(null,"Today is Tuesday!"); break;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: case 4: JOptionPane.showMessageDialog(null,"Today is Wednesday!"); break; case 5: JOptionPane.showMessageDialog(null,"Today is Thursday!"); break; case 6: JOptionPane.showMessageDialog(null,"Today is Friday!"); break; case 7: JOptionPane.showMessageDialog(null,"Today is Saturday!"); break; default: JOptionPane.showMessageDialog(null, "Sorry, the number you entered is incorrect"); } System.exit(0); }}...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online