Question: Write a program in java that plays the number guessing game using loops and conditions. 1. Ask the user for the range of numbers, ie

 Write a program in java that plays the number guessing game

Write a program in java that plays the number guessing game using loops and conditions. 1. Ask the user for the range of numbers, ie 10 for secret number between 1 and 10, 100 for secret number between 1 and 100. 2. Use the Random object to generate the random secret number with in the range. 3. Prompt the user for their guess. Beased on user guess, tell them to "Guess higher number", "Guess lower number" or "Correct guess after x guesses". 4. Loofashould stop once the user enters a correct guess number, otherwise keep ask for guess number. 5. Your output should look similar to this, Sample Run: Enter range of numbers: 10 (Assume Random object picked 3 as secret number.) Enter your Guess : 5 Hi user,guess lower number Enter your Guess : 1 Hi user,guess higher number Enter your Guess : 3

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!