Program is not exiting loop even thought it appears it knows to

I am making a guessing game where the user inputs the top number and the computer selects a number between 1 and the number that the user input. After the correct number is guessed, it is supposed to leave the do-while it is in and move on to the toString, but does not.

Here is an example:

Guessing Game - How many numbers? 10
Enter a number between 1 and 10: 1
Try again.

Enter a number between 1 and 10: 2
Try again.

Enter a number between 1 and 10: 3
Try again.

Enter a number between 1 and 10: 4
Enter a number between 1 and 10:

You can see that it doesn't say "Try again," but yet asked for another guess.