/** * Name: Stuart Hansen * Course: CSCI 145 - Computer Science I * Section: 001 * Chapter 3 Examples * * Project/Class Description: * This program demonstrates the switch statement. * * Known bugs: * none */ import java.util.*; public class DemoSwitch { public static void main (String [] args) { Scanner kybd = new Scanner (System.in); System.out.println("Enter a number 1-5"); int num = kybd.nextInt(); switch (num) { case 1: System.out.println("Hello world!"); break; case 2: System.out.println("Goodbye cruel world!"); break; case 3: System.out.println("Like hey, Dude."); break; case 4: System.out.println("Good afternoon,good sir!"); break; case 5: System.out.println("Bonjour mes amis."); break; default: System.out.println("I said enter a number 1-5"); } } }