Generate a random 5 digit number as a string - repeat step


develop a number guessing game. The game program should:

Generate a random, 5 digit number as a string.

The player needs to try to guess this 5 digit number.

The program should provide feedback to the player letting them know if they got any of the digits correct, using the Feedback Key (or hints) below:1 = indicates Right Number, Right Place.2 = indicates Right Number, Wrong Place.0 = indicates Wrong Number.For example:
If the computer program generates 12345 as the random number.

The player needs to make guesses in order to figure out what the secret, random number is. If the player guesses 11235, the computer should respond with the feedback code of: 10221.

Repeat step 2 and 3 until the player guesses the whole 5 digit number correctly (or, you can allow the player to do 10, 15, 20 tries).

If the player guesses it correctly, display the message "You guessed it correctly!" If the player doesn't guess it within the limited number of tries, display the message "You couldn't guess it. Game over."

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Generate a random 5 digit number as a string - repeat step
Reference No:- TGS02387348

Now Priced at $10 (50% Discount)

Recommended (96%)

Rated (4.8/5)