CIS 24: CGI and Perl Programming for the Web

Functional Specification for the Digital Camera Shopper Project

Below are the requirements your project is expected to meet. Each section also provides some implementation suggestions. For each of our remaining labs, I'll suggest an area of the project to focus on, and possibly provide some additional suggestions.

  1. Overview
  2. For this project, you will create a web-based application that allows users to shop for digital cameras. There will be a search form where they can choose the features they want in a camera. Your application will analyze the information they submit and present a list of cameras that meet the users' criteria. Users can then pick a camera they like and add it to a virtual "shopping cart." Users should then be able to return to the search form to shop for more cameras. If users add more cameras to their shopping cart, your application must retain the information on cameras that were added to the shopping cart previously by that user. Lastly, your application should recognize returning users by means of a cookie, and make their previous shopping cart available to them.

    The specifications for this project are as follows:

  3. The Camera Search Page
    1. Your camera search page must contain a form that allows users to select from the following criteria for selecting a digital camera:

      • Price: $299 or less; between $300 and $599; $600 or more
      • Built-in Flash: must have; don't care
      • LCD Viewscreen: must have; don't care
      • Picture Storage: 6 or fewer is ok; between 7 and 16 pictures; 17 or more is a must
      • Picture Resolution: 640x480; 1024x768; 1280x960; 1600x1200
      • Storage Media: SmartMedia; Compact Flash; Floppy Disc; Memory Stick
      • USB Connection: must have; don't care
      • Video Connection: must have; don't care
      • Digital Zoom: must have; don't care
      • Optical Zoom: must have; don't care

      If you want to allow the user to select multiple options for some of the criteria (e.g. SmartMedia or Compact Flash) you may do so, but this is not a requirement of the project.

    2. Use a cookie to identify users when they arrive at this page. First, test for the existence of a cookie in the user's browser. If it doesn't exist, create a unique cookie that will last for 1 year.

    3. Include a link that says "View Shopping Cart" that links to the Shopping Cart page.

    Implementation Suggestions:

  4. The Search Results Page
    1. Using the criteria provided by the user, your script will run a search against this text data file. This file contains feature data on 27 digital cameras. The fields are in the same order as described above (except that the first field is the name of each camera). The fields are separated by tabs. Features coded as "0" or "1" indicate whether or not a feature is present.

    2. If there are cameras that meet the user's criteria, your results page should list each camera and its attributes. If there are no cameras that meet the user's criteria, provide a statement indicating this, and provide a link back to the form so he or she can try again.

    3. Hyperlink the names of each camera on the results page to point to a shopping cart script. When a user clicks one of these links, that camera will be added to his or her shopping cart. You'll need to attach a query string to the URL that contains a unique identifier for each camera.

    Implementation Suggestions:

  5. The Shopping Cart Page
  6. Your Shopping Cart Page does not have to allow for quantities greater than 1 for each camera, and it does not have to provide a "delete" function (i.e. you don't have to let users remove items from their carts). You can include these functions for extra credit if you wish.

    Your Shopping Cart Page does have to do the following (for this page, I've incorporated the implementation suggestions into the description of the requirements):

    1. When users come to this page via the link on the Camera Search Page, they are coming to view the current contents of their shopping cart. You should have a text data file that contains a line for each user (the user data file). The line should contain the value of each user's cookie, and an identifier for each camera he or she has selected (from this session and from previous sessions). Use the value of the cookie in the user's browser to determine which line contains his or her information, and display the names of the camera in his or her shopping cart.

    2. When users come to this page via the links on the Search Results Page, they are adding the selected camera to their shopping cart. Your application needs to add the appropriate camera information to that user's line in your user data file. You then need to display the shopping cart contents as described above.

    3. This page should provide a link back to the Camera Search Page.

Return to CIS 24 home page