Instructor: Todd Dole
Did someone say "loops"? This assignment requires several 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.
You can call your class GuessingGame, and save it as GuessingGame.java
The computer will initiate play by "thinking" of a number between 1 and 100 and then asking the user to guess it. The computer will respond by stating whether the guess was too low, too high, or correct. The user will be required to continue guessing until they have identified the number.
Having the user guess involves generating a “random” number. The following mathematical statement can be used to store such a value in the integer variable n:
n= (int) (Math.random()*100.0)+1;
Additional requirements of the program are:
Please submit your GuessingGame.java file through Canvas.