Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java Design and implement an application that plays the Left - Right guessing game with numbers. It is based on a number line with

in java Design and implement an application that plays the Left-Right guessing game with numbers. It is based on a number line with 0 in the middle, positive numbers to the right, and negative numbers to the left. The program should pick a random number between -50 and 50(inclusive), then repeatedly prompt the user to guess the number. On each guess, report to the user that they are correct or that the target number is to the left or right of the guess. Continue accepting guesses until the user guesses correctly or chooses to quit. Count the number of guesses and report that value when the user guesses correctly. If a guess is out of the range -50 to 50, an appropriate message should be displayed to the user and the guess not be counted. At the end of each game (by quitting or a correct guess), prompt to determine whether the user wants to play again. Continue playing another game until the user chooses to stop. hint: This will require a nest of loopsthe outer loop to play each game until the user chooses to stop and the inner loop to prompt the user for each guess in a game. do not use try or catch blocks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Finance The Role Of Data Analytics In Manda Due Diligence

Authors: Ps Publishing

1st Edition

B0CR6SKTQG, 979-8873324675

More Books

Students also viewed these Databases questions

Question

8. Demonstrate aspects of assessing group performance

Answered: 1 week ago