import java.util.Scanner;
public class Hilo {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
String playAgain = "";
do
{
int theNumber = (int)(Math.random()*100+1);
System.out.println(theNumber);
int guess = 0;
while(guess != theNumber)
{
System.out.print("Guess a number between 1 and 100:\n");
guess = scan.nextInt();
System.out.print("You entered " + guess + ".\n");
if(guess < theNumber)
System.out.print( guess + " is too low. try again.\n");
else if(guess > theNumber)
System.out.print( guess + " is too high. try again.\n");
else
System.out.print( guess + " is corret. You win.\n");
}
System.out.print("would you like to play again(y/n)?");
playAgain = scan.next();
}
while(playAgain.equalsIgnoreCase("y"));
System.out.print("Thank you for playig, GoodBye");
scan.close();
}
}