This is an HTML embedded with Javascript file use javascript for the following: A. Generate a random integer number between 0-10 and store it as constant B. Prompt user to enter number between 0-10 (guessing the secret number). User should be allowed a maximum of 3 attempts to guess the number. If user clicks on cancel, exit the program. C. If the value entered by user is not a number, alert user (That was not a number, please try again). and do not count that as an attempt D. If user guesses the right number, exit loop and display congratulation message: “Congratulations, it took you n number of attempt/s” E. For those who embrace extra challenge: Enhance your code to alert user a hint message, i.e "That was too low", or if the number was higher, display alert message "That was too high"
This is an HTML embedded with Javascript file
use javascript for the following:
A. Generate a random integer number between 0-10 and store it as constant
B. Prompt user to enter number between 0-10 (guessing the secret number). User should be
allowed a maximum of 3 attempts to guess the number. If user clicks on cancel, exit the
program.
C. If the value entered by user is not a number, alert user (That was not a number, please try
again). and do not count that as an attempt
D. If user guesses the right number, exit loop and display congratulation message:
“Congratulations, it took you n number of attempt/s”
E. For those who embrace extra challenge:
Enhance your code to alert user a hint message, i.e "That was too low", or if the number
was higher, display alert message "That was too high"
Step by step
Solved in 6 steps with 4 images