//************************************************ // Program Name: guesshilodriver.java * // Author: Pat Moss * // Date: Oct 22, 2005 Rev: 01 * // * // Demonstrate a main driver for guesshilo.class * //************************************************ import java.util.Scanner; public class guesshilodriver { public static void main (String[] args) { String inputresponse = ""; // the user input response guesshilo guesshilo1 = new guesshilo(); Scanner scan = new Scanner(System.in); System.out.println ("guesshilodriver.java by pat moss"); System.out.println (""); System.out.println ("Play the Guess Hi Lo Game."); System.out.print ("To continue press 'Y', to exit press 'N':"); inputresponse = scan.nextLine().toUpperCase(); while (inputresponse.charAt(0) == 'Y') { // Use the sentinel value of 'Y' to continue the loop guesshilo1.startguesshilogame(); System.out.println (""); System.out.println ("Play the Guess Hi Lo Game."); System.out.print ("To play again press 'Y', to exit press 'N':"); inputresponse = scan.nextLine().toUpperCase(); } System.out.println ("All Done..."); } }