Please help me to write this code! Objective: In doing this lab you will learn a
ID: 3649988 • Letter: P
Question
Please help me to write this code!Objective: In doing this lab you will learn about iteration (one of the three basic control mechanisms in programming, the others being sequence and branching). You will also develop a command-line interface for your software.
Specification: Use Java to write and run a guessing game program that will think of a number and invite a user to guess it. After each guess, the game will tell the user if his/her guess was high or low or if they guessed correctly, and then ask the user to guess again. The game will continue to ask for the next guess until either the user guesses correctly or gives up. When the game ends, if the user finally guessed the correct number, the game will tell the user how many guesses were needed and whether the user was a good guesser or not. If the user quits before guessing correctly, he/she will be suitably insulted.
Here are two examples of how the game should work:
Welcome to the Guessing Game.
I am thinking of a number between 0 and 1000.
What is your guess? 25
Good guess, but 25 is too low.
What is your guess? 768
Good guess, but 768 is too high.
What is your guess? 432
Correct! It took you only 3 guesses. You win!!
Or,
Correct, it took you 23 guesses. Don