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"

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question

 

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"

Expert Solution
steps

Step by step

Solved in 6 steps with 4 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,