UMBC CMSC 201 Fall '03 | CSEE | 201 | 201 F'03 | lectures | news | help |
CMSC 201 Road Trip
Out: Wednesday 10/22/03
The design document for this project, design3.txt ,
|
On our trip, we kept track of our gas purchases and mileages so that we could see how many miles per gallon our car was getting. We found that our gas mileage varied quite a bit depending upon whether we were logging highway miles or were in slow traffic situations. The price of a gallon of gas varied quite a bit too. The highest price paid was on the New Jersey Turnpike. No surprise there. We also kept track of the amount of cash we were spending. We used cash for food, admission to museums and other attractions, souveniers, and miscellaneous items. We charged all of our hotels bills and gas purchases.
For this project, I would like you to use the information from the old trip to estimate the cost of the new trip.
Using the total number of miles for the entire trip, the miles per gallon that you've calculated from last summer's data and the current price of gasoline per gallon, you must calculate the total cost of the gasoline for the new trip. Using the average cost per night for accomodation that you've already found, and the number of nights planned for the new trip, you can calculate the cost of accomodations. Using the cash spent per day that you've found from last summer's trip, and the number of days expected for the new trip, you can calculate the total cash needed.
You must then generate a report about the gas mileages similar to the one shown in the sample output. It doesn't have to look exactly like the sample, but the numbers should agree and all of the same information needs to be shown.
You must generate a report about the hotels that contains all of the information shown in the sample output. Again, your report doesn't have to look exactly like mine, but the numbers should be the same.
You must print a report, as in the sample output about the legs of the journey. Your output must be in a reasonable format although it need not look just like the sample.
The data files are gas.dat, hotels.dat, and newtrip.dat, which can be viewed from these links. 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/gas.dat .
cp /afs/umbc.edu/users/s/b/sbogar1/pub/hotels.dat .
cp /afs/umbc.edu/users/s/b/sbogar1/pub/newtrip.dat .
The space and the . (dot) at the end of each command are necessary and a part of the command.
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.
You must use separate compilation for this project and should have a file, called proj3.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 Proj3 proj3.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.