Question: Java Question: Create a number guessing game program. The program should utilize a random number generator of type integer between 1 and 10. Call this

Java Question: Create a number guessing game program. The program should utilize a random number generator of type integer between 1 and 10. Call this variable secretNumber. The program should allow users to enter a number in order to guess what the secret number is. If the guessed number is greater than the secretNumber, the program should display the message "Guess Lower!". If the guessed number is lower than the secretNumber, the program should display the message "Guess Higher!". The program needs to run until the user correctly guesses the secretNumber. When the user guesses the number correctly, the program should display the message "You got it right! You win!".

Hint: Use an if-else statement within a while loop.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!