Question: Q.) Write an algorithm and then the code for a java program that is a random number guessing game. The program should generate a random

Q.) Write an algorithm and then the code for a java program that is a random number guessing game.

The program should generate a random number between 1 and 200 inclusive. This number should be generated only one time for each game that is played.

The player is given 5 attempts to correctly guess the number.

If the player guesses the number correctly in the given number of guesses, the player wins and is asked if he/she wants to play again.

If the player has guessed incorrectly after all 5 attempts, the player loses the game and the program will show the player the correct number. The player is then asked if he/she would like to play again.

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!