// Sentence.java (c) 1997-2004 Kari Laitinen // http://www.naturalprogramming.com // 2004-10-10 File created. // 2004-12-19 Last modification. import java.util.* ; class Sentence { public static void main( String[] not_in_use ) { Scanner keyboard = new Scanner( System.in ) ; char character_from_keyboard ; System.out.print( "\n Type in L, M, or S, depending on whether you want" + "\n a long, medium, or short sentence displayed: " ) ; character_from_keyboard = keyboard.nextLine().toUpperCase().charAt( 0 ) ; System.out.print( "\n This is a" ) ; switch ( character_from_keyboard ) { case 'L': System.out.print( " switch statement in a \n" ) ; case 'M': System.out.print( " program in a" ) ; case 'S': System.out.print( " book that teaches Java programming." ) ; default: System.out.print( "\n I hope that this is an interesting book.\n"); } } }