else {//computer start guessing computerGuess = Math.abs(rand.nextInt()) % (endN
ID: 3839596 • Letter: E
Question
else {//computer start guessing computerGuess = Math.abs(rand.nextInt()) % (endNum = startNum) + startNum;}/*The computer repeatedly tries to guess it by guessing System.out.print("Is it " + computerGuess + "?(y/n) ");//Increment Number of Guesses numberOfGuesses++; String input = console.nextLine();//check input if(input.charAt(0) == 'n') {if startNum > = computerGuess) {startNum = computerGuess + 1;} else endNum = computerGuess - 1;} else if (input.charAt(0) == 'y') {guess = true;//Display reports how many guesses it made System.out.println("I got your number of" + computerExplanation / Answer
Answer:
Please replace the lines from 166 to 169 with below code then compilation errors will be fixed.
if(startNum >= computerGuess) {
startNum = computerGuess + 1;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.