Assignment 4


Home Lecture Notes References Course Software Assignments

Useful Links

The marking sheet is now available in either doc or pdf formats.

This assignment is due December 5 by 1:30pm. All files must be uploaded at this time and you will turn in a paper version of your assignment in class.

For this assignment you will be adding an order form to your Assignment 2 website. Do not directly edit your assignment 2 files. Instead, make a copy of your assignment2 folder and rename it assignment4. You will edit the navigation in your assignment4 files such that it is now possible to order your products from you business website

You will be creating an order form in HTML. This order form should be processed by the Python script you will write in order to produce a receipt for the user of your website.

HTML Order Form Requirements

  1. The order form must contain:

    1. Customer name
    2. Customer Email address
    3. Customer address including: street address, city, province (max of 2 characters), and postal code (max of 6 characters)
    4. Credit card information including: type (MC, AMEX, etc.), 16 digit credit card number, and expiration date
    5. A list of products availbe for sale and their price. Users should be able to order between 0 and 999 of each item. You must have at least 5 products
    6. You must provide an option for gift-wrapping or to give the products as a gift. If selected, all items will be gift-wrapped.
    7. You must provide an option which allows users to receive an email notification, either when their product has shipped, their order has been processed, or when there are new product updates
    8. A submit button

  2. The order form should be clearly organized

  3. You shoud use color, company logo, etc.

    You may use the stylesheets from your assignment 2, create a new stylesheet for the order form and receipt, or use an internal stylesheet. Remember to keep the colors similar to that of the rest of your website, as it should appear to be part of your previous work. However, order forms and receipts often have light colored backgrounds. This is a good choice.
  4. Your order form must validate XHTML 1.0 Strict. Place the graphic link from W#C on the bottom of the page

Python Requirements

  1. You must write a Python script which executes when the user presses the submit button on your order form

  2. This script should produce a receipt for the user with the following information:

    1. Customer name
    2. Customer Email address
    3. Shipping address
    4. Credic card information with the credit card type, expiration date, and credit card number with the following format: xxxx-xxxx-xxxx-1234 where the "1234" is the last 4 digits of their entered credit card
    5. The products they ordered with name, quantity, unit price, and total price. For instance, if they order 2 t-shirts at $10 a piece, you need to display the t-shirts, $10 per piece, 2 pieces ordered, and a total of $20
    6. If the user selects gift-wrapping, add $2 to their bill for each item ordered. If they order 2 t-shirts and 3 coffee cups, the total cost of gift-wrapping is $10
    7. If the user spends more than $150, you must apply a 15% discount to their pre-taxed total (and before being gift-wrapped)
    8. If the user is from BC, you should apply a 14% sales tax to the cost of their goods (after gift-wrapping and discount where applicable) If the user is from AB, you should apply a 9% sales tax. Any other province, has a 7.5% sales tax
    9. You must display the following prices on the receipt clearly labeled:
  3. The Python script must output valid XHTML 1.0.

  4. The resulting web page must be clearly organized, use some color and perhaps company logo, and be easy to understand.

    Feel free to use the same stylesheet as you had for assignment 2 or to write a new one.
  5. You must write at least 2 functions

  6. When the user enters their province you should be able to correctly handle input in any combination of lower and uppercase characters.

    For example, BC, Bc, bC, bc, AB, Ab, aB, ab
  7. If the user selected email notification, you must print the appropriate notice.

    For instance if you choose to have an email notification that their order has shipped, display on the receipt "You will be notified when your order has shipped"
  8. A "thank you" for purchasing goods from your site

Paper Requirements

  1. Printed copy of your python script

  2. Printed copy of your HTML order form (print the HTML not just the screenshot)

  3. Screenshot of your order form

  4. Screenshot of the receipt generated from your script

  5. Copy of the marking sheet

General Requirements

  1. You must provide a link from your index.html to the main page of your business site. Do not make the link go directly to the order form
  2. All of your files should be in a folder called assignment4
  3. Upload all files to the CMPT165 server
  4. Submit the zipped version of the assignment to the submission server
  5. Submit the paper requirement on the due date in class

Notes