Question: Answer in java. Do a do-while loop, not a strange loop. To learn to use do-while loops You should generate a random number between 1
To learn to use do-while loops You should generate a random number between 1 and 10, then prompt the user for a guess. If the guess is incorrect then you should print "Nope"; if the guess is correct you should print "Well done". Once the user has guess correctly you should ask them to type 0 to stop the game or any other number to play again. Get the program to generate and output the random number first. Then get the program to play the game just once. Finally get the game to repeat. You will need to use "nested loops" to complete this assignment. What's your guess? 6 Nope. What's your guess? 7 Well done! Play again? (0 to stop): 1 What's your guess? 7 Well done! Play again? (0 to stop): 0 Thanks for playing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
