CS 2135 (C02) Project
A Languages Perspective on Web Programming: Part 1

Project Motivation and Goals

The first lecture argued that programming and programming languages are deeply intertwined; programming languages affect how we think about programming, and new programming problems inspire evolution in programming languages. This project explores the relationship between batch (standard textual, sequential) and web programming to set the stage for the programming languages topics that we will cover after the midterm.

We will do the project in two stages. This handout describes the first stage; the second stage handout will be provided after the midterm.

After completing this stage of the assignment, you should be able to:


Due Date

The project is due February 3 (Sunday) at 11:59pm via turnin (use assignment name project1).

Note that the due date is right after the midterm. We will begin discussing web programming in class just after the midterm, and you need to have done this project before we discuss web programming in class. Rather than force everyone to turn the project in earlier, I've set the due date to give you flexibility in scheduling your time. However, the due date is a rope — don't hang yourself with it. I will not grant extensions on this project unless you have a documented emergency.

If you've never written web pages or scripts, the programming parts of the assignment may be a bit time-consuming. Start early.

If you need help figuring out what the assignment is asking you to do or how to get started, come to office hours for help.


The Assignment, Stage 1

This stage has three parts: two programming parts, and one analytical part. Be sure to keep a copy of all work you do on this stage for use in the next stage.

Problem Set-Up

You're going to implement a simplified prototype of a program for generating driving directions (similar to the programs on the web that do this -- see Yahoo!'s driving direction service for an example). A request for directions contains several pieces of information: the origin and destination cities, whether to display all routes found or just the shortest route, the name of a city to avoid (if any), and the name of a city to visit enroute (if any).

The actual driving direction services on the web let you store your home address so that you don't need to type it in every time. In similar spirit, users of your program should only need to enter their starting city once (this will be called the "personalization feature" in the rest of this document).

In this assignment, you will implement two versions of the simple driving directions program: one textual (in Scheme) and one web-based (in the CGI scripting language of your choice). Each prototype will gather information about the desired route and display possible routes that satisfy the constraints. Your prototypes must support at least the set of cities and routes provided below. See the interface prototype samples for an idea of what kind of interfaces we expect you to develop for this assignment. You may develop fancier interfaces if you choose, but be aware that they will not earn you extra points towards your project grade.

Cities and Routes to Support

Your prototype should support at least the following routes/distances, in either direction. Your program can hard-code the listed routes -- you do not need to write a program to generate the routes from the distances between individual cities.

RouteDistance
Providence-Hartford 75
New Haven-Hartford 39
New Haven-New York 80
Hartford-New York 120
Worcester-Hartford 63
Worcester-Providence 40
Worcester-Boston 47
Providence-Boston 50
Providence-Hartford 75
Providence-New Haven 103
Providence-Hartford-New Haven 134
Boston-Providence-New Haven-New York 233
Boston-Worcester-Hartford-New York 230
Boston-Providence-Hartford-New York 245
Boston-Worcester-Providence-New Haven-New York270

Problems

In both programming problems, assume that the user of your programs always enters valid input. You programs do not need to do any error checking.


What to Turn In

Submit the following files via turnin:

Grading

Some notes on what we will be looking for in grading this assignment:


Links and Hints

NOTE: I do not intend for you to go buy books on CGI programming, or to spend hours pouring through html documentation to figure out individual language constructs. If you know precisely what you want to do, but aren't sure how to do it, ask one of the course staff!. I want you to spend your time figuring out the kinds of constructs that you need, not the minute details of writing them down. Please don't post these kinds of questions to the discussion board though -- we want everyone to figure out the big picture without hints from the discussion board.

Suggestions for links to additional tutorials and pages that you find useful in doing this assignment are welcome.


Collaboration Policy

This is an individual project. Collaboration is not permitted on this assignment. The course staff are the only people you may approach for help with this project. You may not ask anyone outside of the course staff questions on any aspect of this project, including how to write and run CGI scripts; this includes webmaster@wpi or helpdesk@wpi. If you believe there's a problem with running CGI scripts from your account that warrants CCC assistance, get permission from the course staff to contact helpdesk.

In particular, do NOT bother webmaster@wpi or helpdesk@wpi if you get an "Internal Server Error" while developing your code. This error likely appears due to a bug in your script, not a problem on the server. If you are convinced you have a server error, contact the course staff before contacting any systems staff.