Answer:
1. The loop will run unless the value of answer equals to Capital N. The method equals is “case-sensitive” that is lower case letter and upper case letters are considered different. That “a” and “A” means the same to us, but for the method equals it is different and equals method will return false if the case is not matching.
2. a (int)(Math.random() * (upper − lower) ) + lower
Since we need to consider the lower limit value together to get the desired results we need to add the value of lower limit to the multiplied answer.
3. b while(userGuess != secretNumber || userGuess >= lowerLimit && userGuess <= upperLimit)
Here the program is required to check the while loop and exit when user guess the number or we can say the loop should continue until the user guess the number, so that is why we have taken userGuess!=secretNumber. Next the loop should be exited if it is not within the range or we can say that the loop should run only if the guessed number is within the upper and lower limit. That is why we have opted for the condition userGues>=lowerlimit && userGuess<=upperlimit. Why we have taken && as the operator is that, it’s a range of values so && operator best suit for this kind of logical condition.