Homework 3 | CS 4, Summer 2007 | Due: July 20



Directions: Submit hardcopies (paper copies) of your solution to the written questions (W). For the HTML questions (H), submit a hardcopy of your HTML code and write on the hardcopy the URL that contains your web page. Update your cs4/index.html to point to each HTML/Javascript solution. Make sure to place your name on the first page of your fully stapled homework. The point values for each question are as specified.
  1. (H: 50) Create a web page similar to that shown below. Your web page should consist of a single table with two columns. The first column has three rows with the buttons labeled dumb, dumber, and dumberer. The second column contains two rows - the first row (spanning the height of two buttons) will display an image, and the second row (spanning the height of one button) contains a text window. In the BODY portion of your web page create this table with the buttons, and display a blank image (see blank.jpg below) and an empty text window when the web page is first loaded. In the HEAD portion of your web page write a single javascript function that displays different images depending on which button is pressed. This function should also display the string "dumb", "dumber", or "dumberer" in the text window in accordance with which button was pressed. (NOTE: you do not need to make the width of the buttons and text window match exactly what is shown below.)



    Below are links to the four images that you will need. Click on the link to view the image. Save each image to your computer by dragging the image to your desktop. You will also need to upload these images to your web page when submitting your homework.

    Images: blank.jpg | dumb.jpg | dumber.jpg | dumberer.jpg

    The following written problems are from "An Invitation to Computer Science":
  2. (W: 10) Chapter 2, Exercise 11
  3. (W: 10) Chapter 2, Exercise 18
  4. (W: 10) Chapter 2, Exercise 23
  5. (W: 10) Chapter 3, Exercise 1
  6. (W: 10) Chapter 3, Exercise 18