Question: you have modified to remove the break statement and replaced it with codes (combination logic) that yields the same display results Programming (30 points) 3.0

 you have modified to remove the break statement and replaced it
with codes (combination logic) that yields the same display results Programming (30
points) 3.0 3.1 (10 points) In class, we used this high-ow guessing

you have modified to remove the break statement and replaced it with codes (combination logic) that yields the same display results Programming (30 points) 3.0 3.1 (10 points) In class, we used this high-ow guessing program (HilowGuesser.java) to demonstrate the binary search using a while loop for the quest. The program generates a random number between 1 to 100. The user can guess the number based on the high or low feedback from the program. This (given) program loops forever until you enter the correct guess. If you follow the binary search scheme (keep dividing X), you should get the right number in 4 guesses on average. Please download the program and run it without modification. Try to enter the incorrect guess multiple times and watch the "sorry" display endlessly For this problem, modify the given codes to limit the number of searches based on what you specified. You can use a Scanner object variable or hard code it to a variable you defined. You also need to display the total number of guesses done. You are not allowed to use the "break" statement to get out of the while loop. Bonus (3 points) if you prevent a user from entering the same incorrect guess. DFO o G C Guesser.java - Eclipse IDE + Run Window Help HilowGuesser.java BreakinWhile.java 1 package com. Coding; 20 import java.util.Scanner: 40 / 5 - This program generates a random number between @ to 99. User will need 6 to guess the number to exit the guessing loop. 7 8 9 12 13 10 public class HilowGuesser { 21 public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); int guess, sl; 14 15 Random r = new Random(); // using the Random() object 16 $1 - r.nextInt(100); 17 IS System.out.println("I'm thinking of a number between 1-100); 19 System.out.println("Try to guess it!"); 29 System.out.print(" "); guess- keyboard.nextInt(); while (51 != guess) { if (guess sl) 1 Problems Javadoc Declaration Consoles Toba Mar 2021 9:36:31 PM - 8:36:33 PM) serijava ect Run Window Help 5. HiLowGuesser.java 33 BreakinWhile.java 15 Random r = new Random(); // using the Random(object 16 si = r.nextInt(100); 17 18 System.out.println("I'm thinking of a number between 1-100."); 19 System.out.println("Try to guess it!"); 20 System.out.print(" "); 21 guess - keyboard.nextInt(); 22 28 while (s1 1- guess) { 24 if (guess s1) { 29 System.out.print("Sorry, your guess is too high. "); 30 31 } 32 System.out.print(" Try again. In> "); 38 guess = keyboard.nextInt(); 34 } // end of while 35 System.out.println("You guessed it! What are the odds 1); 36 }// end of main 37 38 } // end of HiLoGuesser 59 10 a

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!