Let's play a guessing game!
Complete a method named
getSecretValue which is passed an instance of a
Secret class provides a single method
guess which accepts an
true if you have guessed the secret value, and
You can either
require that the passed
Secret is not
null or mark the parameter as non-
Write code to determine the secret value between 0 and 31, inclusive.
If the secret does not fall in that range, you should return
However, note that the
Secret class will fail if you guess again after you have already guessed the secret value!
So as soon as you find the secret, your code should return it and not guess again.
Additional guesses will cause your submission to be marked as incorrect.