1. (50 points) An apparel company sells sweatshirts on their web site. They wish to include an option for users to enter information they wish to have monogrammed on the sweat shirt they purchase. Users are allowed two lines of text with a maximum of 20 characters on a line. Users must also specify the sweat shirt color, text color and text font. The format for the options appears below:
The page uses: a form named f1; the Shirt Color radios buttons are named c; the Text Color radios are named t; the Font radios are named f; and the two text boxes are t1 and t2. When the user clicks the button labelled "SHOW ME" the javascript function named p1 is executed. The p1 function:
1.Checks to be sure:
|
CAPTAIN WEBB JUNIOR'S MATH GAME | ||||
|
When clicked, the digit images in the last row call a sub named answer and pass the value of an integer (e.g.,: <img src= '0.gif' border='1' onClick= 'answer(0)'> <img src= '1.gif' border='1' onClick= 'answer(1)'> <img src= '2.gif' border='1' onClick= 'answer(2)'> ...etc. When loaded, the program executes a sub named p2b. This sub: 1. Generates two integers (fn and sn) each between zero and 9 inclusive (i.e., 0,1,2,3,...8,or 9) 2. Displays the associated image file for fn in the first cell of the second row. 3. Displays the associated image file for sn in the third cell of the second row. 4. Places the question mark image (q.gif) in the fifth cell of the second row (using the DIV block with id="ans_id") 5. Places click.gif file in the DIV block with id="ins_id" in the third row 6. Stores the sum of fn and sn in a global variable named right_answer |