Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN JAVA A simple guessing game Write a program that will generate a random number between 1 and 10 and allow the user to guess
IN JAVA
A simple guessing game Write a program that will generate a random number between 1 and 10 and allow the user to guess the correct number. The user should be llowed to keep guessing until they guess the correct number. They will start with 10 points and will have 2 points deducted for each guess. You should continue to deduct 2 points per guess even when the points become negative. Required: user enters a number between 1 and 10. If a number out of range is entered you should display a message and allow them to input again, You must use a while loop to solve the problem. Please note that a do-while loop is not a while loop. When the user guesses correctly tell them their score and how many guesses it took for them to guess correctly Please note, you are required to use a whille loop. Also note that a do-while is not a while loop. . Input-A guess between 1 and 10 Process-The number of guesses and the point total Output- The users score and the number of guesses The following is an example of how your program should functionStep 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