Get Instant Help From 5000+ Experts For
question

Writing: Get your essay and assignment written from scratch by PhD expert

Rewriting: Paraphrase or rewrite your friend's essay with similar meaning at reduced cost

Editing:Proofread your work by experts and improve grade at Lowest cost

And Improve Your Grades
myassignmenthelp.com
loader
Phone no. Missing!

Enter phone no. to receive critical updates and urgent messages !

Attach file

Error goes here

Files Missing!

Please upload all relevant files for quick & complete assistance.

Guaranteed Higher Grade!
Free Quote
wave
JavaScript Lotto Game - Generate Random Number & Check Winning Results

Instructions

Question 1

1. Create a global variable called lotto that is initialized to 0.

2. When the Generate Number button is pressed, a function should generate a random 2-digit number andset the lotto global variable to be this number.

3. When the Check My Numbers button is pressed, a function should check to see if the number entered bythe user is valid and if it is a winner.

The number is valid if it is a 2-digit number

The number is a winner in the following three scenarios:

If it matches the lotto number in the exact order, the award is $10,000.

If both digits in the user input match both digits in the lottery number, but out of order, theaward is $3,000.

If one digit in the user input matches a digit in the lottery number, the award is $1,000

support
close