Assignment 4
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
The order form must contain:
- Customer name
- Customer Email address
- Customer address including: street address, city, province (max of 2 characters), and postal code (max of 6 characters)
- Credit card information including: type (MC, AMEX, etc.), 16 digit credit card number, and expiration date
- 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
- You must provide an option for gift-wrapping or to give the products as a gift. If selected, all items will be gift-wrapped.
- 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
- A submit button
The order form should be clearly organized
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.
Your order form must validate XHTML 1.0 Strict. Place the graphic link from W#C on the bottom of the page
Python Requirements
You must write a Python script which executes when the user presses the submit button on your order form
This script should produce a receipt for the user with the following information:
- Customer name
- Customer Email address
- Shipping address
- 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
- 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
- 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
- If the user spends more than $150, you must apply a 15% discount to their pre-taxed total (and before being gift-wrapped)
- 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
-
- You must display the following prices on the receipt clearly labeled:
- All information from item 5 above
- Total value of goods purchased (before tax, gift-wrapping, shipping, and discount)
- Amount of discount
- Cost for gift-wrapping
- Amount of taxes
- Cost for shipping
- Total cost for the purchase.
The Python script must output valid XHTML 1.0.
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.
You must write at least 2 functions
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
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"
A "thank you" for purchasing goods from your site
Paper Requirements
Printed copy of your python script
Printed copy of your HTML order form (print the HTML not just the screenshot)
Screenshot of your order form
Screenshot of the receipt generated from your script
Copy of the marking sheet
General Requirements
- 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
- All of your files should be in a folder called assignment4
- Upload all files to the CMPT165 server
- Submit the zipped version of the assignment to the submission server
- Submit the paper requirement on the due date in class
Notes
- You may use tables to lay out your form and to lay out the receipt.
- Also, you should provide navigation links from your order form back
to your website. The easiest method is simply to include the navigation bar from your assignment 2 on the order form itself.
This should also probably be included on the receipt.
- Use triple-quotes to print large blocks of HTML in your python script, instead of a long series of print statements.
- Get started soon, and get help if needed.