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

CMSC 201
Programming Project Five

Road Trip 2

Out: Monday 11/24/03
Due: before Midnight, Monday 12/8/03

The design document for this project, design5.txt ,
is due: Before Midnight, Sunday 11/30/03

The Objective

This project will give you practice using good design techniques, separate compilation, arrays of structures, command-line arguments, file handling, dynamic memory allocation, string manipulation, and a linked-list implementation of a list ADT.

The Background

This project is a trip planner, rather than the trip cost estimator that we wrote in Project 3. It doesn't really do any cost estimating, but will allow you to plan a trip by including a list of attractions, their cost and time necessary to see them to each of the legs of the trip.

If you wanted to do so you could use Project 3 in combination with this project to make yourself a really nice trip planning package. There is not enough time in this course to do so, however. ... A Winter Project ? ;)

The data files for this project are trip2.dat and attractions.dat. trip2.dat is of the same form as the newtrip.dat file from project 3, except that cities with multiple words in their names no longer use underscores between the words. Since the planning has been much more careful at this point, many of the origin and destination cities are different (to allow more time to view attractions).

The Task

Your task is to read the legs of the trip in from the trip2.dat file, and then construct a linked list of attractions for each of the legs of the trip using the information found in the attractions.dat file. Please note that not all legs of the trip will have attractions. Those legs then will have an empty list of attractions and you should print out an appropriate message for those. (See sample output).

As in Project 3, the trip2.dat file contains information about each leg of the journey, which includes a city of origin and the destination, the number of days planned to stay at the destination and the number of miles from the origin to the destination of that particular leg.

The attractions.dat file contains the origin and destination city of a leg as a string, the name of an attraction, the cost of that attraction for 2 adults, and the amount of time needed to see that attraction, followed by the three pieces of information for each of the other attractions for that leg and then a line of 5 dashes, -----. Legs of the journey that have no attractions are not in the attractions.dat file.

More details

The data files

The data files are trip2.dat and attractions.dat You should NOT view it and save it into a file or cut and paste it from the browser into a file. Either of these methods of obtaining the file may cause there to be extraneous characters in the file that your program will try to read and disrupt the input of your data. Instead you must copy the files from my directory into the directory that you'll be using to work on this project.

Go to that directory and then issue the following commands exactly :

cp /afs/umbc.edu/users/s/b/sbogar1/pub/trip2.dat .
cp /afs/umbc.edu/users/s/b/sbogar1/pub/attractions.dat .

The space and the . (dot) at the end of each command are necessary and a part of the command.

Sample Output

Since the output file is large, instead of showing the output here, I am just providing a link to my output file, output

Although your output may look different than mine, you should print out the same information.

What to Turn In

You must use separate compilation for this project and should have a file, called proj5.c, that contains only the function main(). You should also have several other .c and .h files. I'll leave the naming of them to you.

Submit as follows:

submit cs201 Proj5 proj5.c (followed by any other .c & .h files you have)

The order in which the files are listed doesn't matter. However, you must make sure that all files necessary to compile your project are listed. Don't forget to submit your .h files