Assignment 2 -- due Wednesday Sept. 14 -- Elementary JavaScript

1.1 Develop six images, each 200 pixels square. Develop a page containing one image tag. The image displayed automatically switches among (rolls over) the six images, displaying any particular image for 500 milliseconds before switching to the next. Whenever a user clicks on one of the images, the animation stops if it is running or starts if it is stopped.

1.2 Use the six images developed in part 1.1. Build a page with four of these  images displayed in <img> elements arranged in a 2 x 2 grid. Each time a user clicks on any of the four  images (some of which may be the same), a new image is chosen for that cell. The new image is chosen randomly with equal probability from the five other images not in the chosen cell. Whenever all four displayed images are the same (the <img> tags have the same src file);then the four images are reset randomly.

1.3 Develop a web page containing a form with an input field and a button. When the user enters a number, n,  into the form and clicks the button, a function is activated which opens a window (or a frame or a <div>) containing an n-by-n multiplication table containing row and column labels as well as the products of row and column labels, as shown in the illustration. Validate input to make sure it is numeric and in the range 3 through 10. Typeset the table as closely as possible to the illustration with horizontal rules and color-coding of the columns. Ideally the size of the window should be determined by the size of the integer entered.


Extra Credit -- Intermediate JavaScript

1.4 Make the page opened in 1.3 have certain errors or noise in the table: let the probability of an incorrect entry in the table be .15. Furthermore let the incorrect answers be plausible by letting each lie within 10% of the correct answer. Let a timer count the seconds as the user attempts to click on each of the incorrect answers. Each time an incorrect answer is correctly identified by the user, let its value be changed to the correct value and its background color changed to light green. Each time a correct answer is incorrectly clicked on by the user, change its background color to light yellow. When the user finishes identifying all incorrect answers in the table, produce a report letting them know how long it took to finish the task, as well as how many correct and incorrect clicks they made.