Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java program that has a user guess a secret number between 1 and 1 0 . Store the secret number in a variable
Write a Java program that has a user guess a secret number between and
Store the secret number in a variable called secretNumber and allow the user to continually input numbers until they correctly guess what secretinumber is
Complete the method guessmynumber that uses a while loop to ask the user for their guess and compares it againist secretNumber
For example, if secretnumber was an example run of the program may look like this:
Im thinking of a number between and
see if you can guess the number!
Enter your guess:
Try again!
Enter your guess:
Try again!
Enter your guess:
Try again!
Enter your guess:
Try again!
Enter your guess:
correct!
Note: In order to pass the grader, you must set the secretNumber to
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