Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started