UMBC CS 201, Fall 00
UMBC CMSC 201 Fall '00 CSEE | 201 | 201 F'00 | lectures | news | help

CMSC 201
Programming Project Three

My Summer Vacation

Out: Monday 10/30/00
Due: Before Midnight, Sunday 11/12/00

The design document for this project, design3.txt ,
is due: Before Midnight, Sunday 11/5/00

The Objective

The objective of this assignment is to give you practice with project and function design. It will also give you an opportunity to work with reading information from a file, structures, an array of structures, passing by reference, and some formatted printing.

The Background

I have been planning my summer vacation and have decided to visit some of the New England states, south-eastern Canada and Niagra Falls by taking a circular route. I have been using mapquest.com and yahoo.com to find out information about the places I'd like to visit and to find out how many miles I'll have to drive between each of these places and the expected driving time between each site.

I have been putting the information that I've collected into a data file called p3places.dat, but it is not in the form that I'd like to see. The first two entries in the file are the starting location's city and state:
Baltimore
MD
After that, the file contains the following fields for each site:
destination city
destination state
miles between the previous location and this one (mileage of this leg)
driving time, which is the elapsed time in minutes

You can view the p3places.dat file to examine its contents and see its format.

You should copy this file into your account by using the following command:
cp /afs/umbc.edu/users/s/b/sbogar1/pub/cs201/P3Data/p3places.dat .

The Task

Design and code a project that will allow you to read in the information from the p3places.dat file, manipulate it to be in the desired form, and produce a chart that looks like the one shown below:

City of Origin Destination Miles Kilometers Time ------------------------------------------------------------------------------ Baltimore MD Lewes DE 114.9 184.9 2 hrs 58 mins Lewes DE Cape_May NJ 17.0 27.4 1 hrs 10 mins Cape_May NJ New_York NY 158.8 255.5 3 hrs 5 mins New_York NY Mystic CT 135.0 217.2 2 hrs 36 mins Mystic CT Gloucester MA 139.8 224.9 2 hrs 42 mins Gloucester MA Kennebunkport ME 74.8 120.4 1 hrs 50 mins Kennebunkport ME Bar_Harbor ME 204.2 328.6 4 hrs 22 mins Bar_Harbor ME Quebec QC 275.9 443.9 6 hrs 20 mins Quebec QC Montreal QC 153.6 247.1 2 hrs 48 mins Montreal QC Ottawa ON 110.0 177.0 1 hrs 59 mins Ottawa ON Toronto ON 248.8 400.3 4 hrs 37 mins Toronto ON Niagra_Falls NY 80.9 130.2 1 hrs 37 mins Niagra_Falls NY Corning NY 149.0 239.7 3 hrs 17 mins Corning NY Hershey PA 188.6 303.5 5 hrs 0 mins Hershey PA Baltimore MD 89.8 144.5 1 hrs 44 mins and give a summary of the total miles, total kilometers, and total driving time in hours and minutes of the complete trip.

The Specifications

Sample Run

ecs225d-sgi-01[102] a.out Your Greeting goes here ... Please enter the name of the vacation information file : p3places.dat City of Origin Destination Miles Kilometers Time ------------------------------------------------------------------------------- Baltimore MD Lewes DE 114.9 184.9 2 hrs 58 mins Lewes DE Cape_May NJ 17.0 27.4 1 hrs 10 mins Cape_May NJ New_York NY 158.8 255.5 3 hrs 5 mins New_York NY Mystic CT 135.0 217.2 2 hrs 36 mins Mystic CT Gloucester MA 139.8 224.9 2 hrs 42 mins Gloucester MA Kennebunkport ME 74.8 120.4 1 hrs 50 mins Kennebunkport ME Bar_Harbor ME 204.2 328.6 4 hrs 22 mins Bar_Harbor ME Quebec QC 275.9 443.9 6 hrs 20 mins Quebec QC Montreal QC 153.6 247.1 2 hrs 48 mins Montreal QC Ottawa ON 110.0 177.0 1 hrs 59 mins Ottawa ON Toronto ON 248.8 400.3 4 hrs 37 mins Toronto ON Niagra_Falls NY 80.9 130.2 1 hrs 37 mins Niagra_Falls NY Corning NY 149.0 239.7 3 hrs 17 mins Corning NY Hershey PA 188.6 303.5 5 hrs 0 mins Hershey PA Baltimore MD 89.8 144.5 1 hrs 44 mins Your trip is a total of 2141.1 miles or 3445.0 kilometers. The total driving time will be 46 hours and 5 minutes. There are 15 legs in this journey. Bon Voyage !!! ecs225d-sgi-01[103]

Submitting the Program

You are to use seperate compilation for this project, so you will be submitting a minimum of three files.
Your C source code file that contains main() MUST be called proj3.c. I would expect that you would also have files called trip.c and trip.h, but you may choose to have additional .c and .h files.

To submit your project, type the following at the Unix prompt. Note that the project name starts with uppercase 'P'.

submit cs201 Proj3 proj3.c trip.c trip.h (and possibly other files, seperated by spaces)

To verify that your project was submitted, you can execute the following command at the Unix prompt. It will show all files that you submitted in a format similar to the Unix 'ls' command.

submitls cs201 Proj3


CSEE | 201 | 201 F'00 | lectures | news | help

Monday, 30-Oct-2000 14:53:34 EST