More Guessing

Take the program resulting from the previous exercise (Guess.java). In BlueJ, create a new class named MoreGuessing. Copy and paste the contents of Guess.java into MoreGuessing.java, but change the name of the class to MoreGuessing (so that the name of the file matches the name of the class.) Change the while loop into a do-while loop.
       // set up (initializations of the counting variables)
       ....

       do
       {
           // read in a guess
           ...
  
           // check the guess and print appropriate messages

           ...
        }
        while ( condition );

A key difference between a while and a do ... while loop to note when making your changes is that the body of the do ... while loop is executed before the condition is ever tested. In the while loop version of the program, it was necessary to read in the user's first guess before the loop so there would be a value for comparison in the condition. In the do... while this "priming" read is no longer needed. The user's guess can be read in at the beginning of the body of the loop.

Submit MoreGuessing.java