
public class loopDemo2 {
	/*
	 * Goal: Write a program that guesses an
	 *   integer number that the user is thinking of.
	 *   
	 *   It should repeatedly ask the user if
	 *   some number 'guess' is their hidden
	 *   number and continue until they respond: "yes".
	 */
	public static void main(String[] args) {
		// Required variables:
		// int 		- (our guess number)
		// String	- to hold the user's response of "yes" or "no"
		int guess = 0;
		String response="no";
		
		// Required code:
		// loop		- continually updating the guess number
		//			  and asking user if that number is correct
		while(response.equals("no")){
			guess = guess + 1;
			System.out.println("Is you number "+guess+" (yes/no)? ");
			response = Keyboard.readString();
		}
		
		// response to user indicating when we've found their number
		System.out.println("Your number was "+guess);
	}
}

