Guessing Game


Guess a number between 1 and 5.

Then click on Guess.

( Hint: Try _  ).

Time remaining for your Guess is 10  seconds.

 

 

     Notes:
     1. Random Guess Number:
         The program chooses a random integer value to guess,
         the Guess Number, in the range 1 to 5.
     2. Countdown timer:
         The user has 10 seconds to key in a Guess value and to
         click on the Guess button.
         If the user does not click on the Guess button within
         10 seconds, a "timeout" alert message is displayed.
         See 4.a. below.
     3. Input values are validated as:
         a. Numeric values, and
         b. Whole integer values, and
         c. Integer values within the range 1 to 5.
     4. Alert messages:
         The program displays two alert message lines (line 1 and line 2)
         in a javascript confirm box with the options "Ok" or "Cancel".
         Alert messages displayed (line 1):
         a. The Guessing Game has timed out.
         b. Sorry, your Guess must be an integer value.
         c. Sorry, your Guess must be an ingeger in the range 1 to 5.
         d. Sorry, Wrong Number...
        e. Congratulations -- You win!!
     5. Program actions:
         Alert messages displayed (line 2):
         For 4.a., 4.b., 4.c., and 4.d.
         The alert message displayed (line 2) is "Do you wish to continue?"
         If the user clicks "Ok", the program retains the same Guess Number,
         and restarts the countdown timer at 10 seconds.
     
         For 4.e. the alert message displayed (line 2) is "Do you wish to play again?"
         If the user clicks "Ok", the program gets a new random Guess Number, and
         restarts the countdown timer at 10 seconds.

         For 4.a., 4.b., 4.c., 4.d., and 4.e., if the user click on "Cancel", the program
         unloads the browser web page.