Enter the lucky1.html text from Figure 7.4 into a new Web page, then load the page in

Question:

Enter the lucky1.html text from Figure 7.4 into a new Web page, then load the page in the browser to verify that it behaves as described.

Most lotteries select winning numbers by drawing numbered balls out of bins. For example, a typical Pick-4 lottery will utilize four bins, each containing balls with numbers starting at 0. If there are 10 balls to choose from in each of four bins, labeled 0 to 9, then 104 = 10,000 different number sequences can potentially be picked. Increasing the number of balls significantly increases the number of possible sequences, which significantly decreases a person's odds of winning. For example, if there are 20 balls to choose from in each bin, labeled from 0 to 19, then 204 = 160,000 different number sequences could be selected.

Make a copy of the lucky1.html page from Figure 7.2 and name it pick4.html. Then modify this new page so that it simulates a Pick-4 lottery. Your page should have one text box, where the user can enter the highest ball number (it is assumed that the lowest ball number is always 0). When a button is clicked, four random ball numbers should be selected and displayed in a message such as the following:

The Pick-4 winners are: 5-0-8-2

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: