Purpose Statement
Did someone say "loops"? This assignment explores nested loops.
The instructions are fairly explicit regarding the behavior the program should exhibit. That will drive how you construct your loops.
There are places where the do-while form of the while loop would be a bit more elegant than the traditional while.
Instructions
Modify your GuessingGame program from Homework 10..
You can call your class GuessingGameII, and save it as GuessingGameII.java
Add the following requirements to your program:
- Validate the user's guess to require it to be in the range 1 to
100. If they enter a value outside that range, display an error
message and have them re-enter the value.
- After the user has guessed the secret number, congratulate them and
then ask them if they want to play again. They should indicate this
by entering a 'y' or an 'n'.
You should validate their response by giving an error message and
having them re-enter the value if they enter anything other than one of
those two responses.
- If the user wants to play again, the computer should select another
secret number and allow the user to continue guessing.
Please submit your GuessingGameII.java file through Canvas.