UMBC CS 201, Spring 08
UMBC CMSC 201
Spring '08

CSEE | 201 | 201 S'08 | lectures | news | help

CMSC 201
Programming Project Three

Vacation Estimator

Out: Monday 3/31/08
Due: Before 11:59 p.m., Sunday 4/13/08

The design document for this project, design3.txt ,
is due: Before 11:59 p.m., Monday 4/7/08

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, using structures, an array of structures, passing by reference, and some formatted printing.

The Background

The dollar isn't fairing well against other world currencies, so a trip to London and Paris this summer wouldn't be financially responsible. Six-week, cross-country road trips of the past are also out of the question due to high gas prices. Since Ocean City is not my idea of fun, I decided to try to plan a two-week, short road trip to see if it will fit our budget.

I've decided to visit some of the New England states, south-eastern Canada and Niagara Falls by taking a circular route. I have been using Google to find 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 finding prices of hotels and B & B's I'd like to use, tour prices and musuem admissions. I can even estimate food costs and balance fine meals with cheap eats. The only part of the trip I can't estimate in advance is the amount I'll have to spend on gas. We have no way of knowing what the price of gas will be in June.

I've been putting the information that I've collected into a data file called vacationPlaces.dat, but it's not in the form that I'd like to see AND we need to estimate the cost of the gas in order to find a vacation total.

The Task

Design and code a project that will allow you to read in the information from a data file, store it in an array of structures so that the file can be closed, and then use the information in the array of structures to find the following totals for the entire trip:

The user will need to enter the following information: Your program will also need to calculate: and will need to produce a chart of transportation data, a chart of costs, and a final report summarizing the information for the user. The charts should present the data nicely formatted with columns of values aligned by their decimal points. See the sample output below.

The data file contains the following information:

You can view the vacationPlaces.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/b/o/bogar/pub/vacationPlaces.dat .

The Specifications

Sample Runs

The 2007 sample run uses gas prices from last summer and
the 2008 sample run uses an estimated price of $4.00/gal expected this summer.

Submitting the Program

You are to use separate compilation for this project, so you will be submitting five files.
Your C source code file that contains main() MUST be called proj3.c. You should also have files called trip.c and trip.h, and util.c and util.h.

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 util.c util.h

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 S'08 | lectures | news | help

Monday, 07-Apr-2008 19:19:14 EDT