COSC 3325 In Class Exercise for 09/12/08

Have this checked at end of class, place the script "inclass3.cgi" in your cgi-bin directory by the due date of assignment #3.

For this exercise, you are to create a script that provides the user with a lunch menu. The user enters his or her name, their menu selections, the script responds with a customer order ( a list of items selected ) and the cost of that order (with 8.25% sales tax added).

The lunch menu should have a choice of 3 sandwiches, 3 sides, and 4 drinks.
Sandwiches are: club, turkey, veggie
Cost: 4.50 each
Sides are: salad, chips, fruit
Cost: 1.50 each
Drinks are: tea, coffee, soda, water
Cost: 1.00 each

After the user has selected from the menu - report back their selections and confirm them. Once confirmed, print order and totals. Make sure the user select enters their name and selects at least one item from the menu. Here is a script that uses the cgi module and a few different input tags. A link to the program .

Hint: Do this in small parts.

  1. Have the script to show a textfield for the name.
  2. Add a submit button.
  3. Show the name back after a submit
  4. Add the sandwich menu.
  5. Show that a name and sandwich selection work.
  6. Add the side menu.
  7. Show that the side menu works.
  8. Add the drink menu.
  9. Show that the drink menu works.
  10. Add in the cost of items.