Create a Java program that runs a guessing game. The computer chooses a random number between 1 and 20. The user
continues providing guesses until they have guessed the number. After each guess, let the user know if their guess was correct,
too low or too high. The execution of your program may look as follows:
I’m thinking of a number between 1 and 20.
What is your guess: 10
What is your guess: S
What is your guess: 8
What is your guess: 7
That’s the number was thinking of! Well done.
- Before the program starts, print the random number to aid testing and debugging.
- Try to figure out how to generate random numbers in Java by doing a Google search. Ifyou have trouble deciphering the
information you find, use the course discussion board to get further clarification.
- Once you have your program running, do some error checking. Check to make sure the user entered a number and that it
is a number between 1 and 20.