Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use only concepts and programming constructs / syntax we discussed in class. DON T USE THE LOOPS ( for or while ) FOR THIS ASSIGNMENT
Use only concepts and programming constructssyntax we discussed in class.
DONT USE THE LOOPS for or while FOR THIS ASSIGNMENT
Problem # points
Write a Java program name it GuessingGameYourname that plays guessing game with the user.
A sample game will run like follows.
The number must be a randomly generated integer number between and for each execution.
Give the user up to three times of guessing chance. Do not use Loop
For each guessing, program will reply to user Too high or Too low or Correct
If the user succeeds in guessing at any chance, the program must skip the remaining chances. hint:
you can use one additional boolean variable to check user guessed correctly or not
For the lastthird guessing, program will reply to user with INCORRECTCORRECT and let user
know the correct answer.
Welcome to the game of Guess It
I will choose a number between and
You will try to guess that number. If your guess wrong, I will tell you
if you guessed too high or too low.
You have tries to guess the number.
OK I am thinking of a number. Try to guess it
Your guess? users input
Too high!
Your guess? users input
Too low!
Your guess? users input
Thats correct! Congratulations!
if third guess is wrong, show incorrect message with the
correct number.
for example, Sorry, my number is
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