Question: Guess the Number Create a script named guess.html which does the following. [40 points] Has a Start New Game form which does the following. [5

Guess the Number

  • Create a script named "guess.html" which does the following.
    • [40 points] Has a "Start New Game" form which does the following.
      • [5 points] Obtains a minimum value for the range.
      • [5 points] Obtains a maximum value for the range.
      • [5 points] Has submit and reset buttons.
      • [5 points] Has a default value of 1 for the minimum value.
      • [5 points] Has a default value of 100 for the maximum value.
      • [10 points] When the submit button is pressed, randomly generate an integer in the indicated range and store it for later. The game is "started".
      • [5 points] Do not allow the game to start if the maximum is less than the minimum or if either quantity is negative.
    • [60 points] When the game is started, do the following.
      • [5 points] Create a section of the webpage called "Current Game".
      • [5 points] The section contains numeric input which contains a number guessed by the user..
      • [5 points] The section contains submit and reset buttons.
      • [5 points] The section contains a "End Game" button.
      • [30 points] When the submit button is pressed, do the following:
        • [10 points] If the value is less than the randomly selected number, emit a message saying "The number I'm thinking of is higher."
        • [10 points] If the value is greater than the randomly selected number, emit a message saying ,"The number I'm thinking of is lower."
        • [10 points] If the number is equal to the randomly selected number, emit a message saying "Congratulations! The number was thinking of was x." (where x is the randomly selected number)
      • [5 points] When the "End Game" button is pressed, remove the "Current Game" section.
      • [5 points] Feedback from the program is delivered via the webpage (rather than an alert or console.log()).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!