CS 4, Summer 2006: HW 2, due Friday, July 14

Instructions

The first part of this homework involves writing HTML. Follow the same instructions as in HW 1 -- write HTML by hand, make it easy to read, print it from the text editor, timestamp it, and upload it to your private folder.

The second part of this homework is a set of written questions. You are not required to write your answers in HTML. However, you should still upload them to your private directory and provide a printout. Upload your file in a format we can read -- plain text, HTML, PDF, Word, or RTF. No timestamp is required.

HTML Problem [70 points]

Create an HTML-based form for a fictitious organization of your own creation. Here's an example order form for a pizza restaurant:

screenshot

Some specific requirements are given below, but part of the point of this assignment is to give you some freedom to be creative. Have fun with it! The look and feel are up to you. As long as you meet the requirements, the content is up to you. Don't feel constrained to creating an order form -- forms are also useful for volunteer sign-up, web-based email, getting driving directions, etc. The form must be something you create, though. You are not limited to only the required features, and may earn extra credit by doing an outstanding page (you must meet the requirements to be eligible).

Requirements:

  1. Use a table (or tables) to specify the layout.
  2. Use an embedded stylesheet to specify the physical appearance, including at least a font and color specification.
  3. Take inputs of at least the following types:
    1. a set of radio buttons, for options from which one can be selected
    2. a set of check boxes, for options from which zero or more can be selected
    3. some text fields, for more free-form input
  4. Give enough textual instructions for the reader of your page to understand what to input.
  5. Give meaningful internal names to the inputs.
  6. Provide a submit button, and have the form "post" its values to the echo program. The entered values will be echoed back, associated with the internal names you gave for the inputs.

Written Problems [30 points]

  1. [10 points]
    Give two examples of real-world conditionals and two examples of real-world loops, beyond those discussed in class or in the book, and not from the world of cooking.
  2. [10 points]
    Choose two 3-digit numbers. Using these numbers, trace the execution of the decimal addition algorithm of Figure 1.2 in the textbook. At each step, show the values for c3, c2, c1, c0, and carry.
  3. [10 points]
    Write a list of 8 names, in sorted order. Use this as N[] for the following two problems.
    1. Trace an execution of Search that successfully finds a who in N[], such that counter > 0 at the end. Show the value of counter throughout your trace.
    2. Trace an execution of BinarySearch that fails to find a who in N[]. Show the values of low, high, and mid throughout your trace.