|
CS-182 -- Final Project: Gas Mileage Winter Quarter 1999-2000 Electrical Engineering and Computer Science Department CC-27C, 277-7339 PurposeIn this project, you will write a C++ program that reads input from an input file, computes some statistics, and writes the results to an output file. This project is designed to make use of many of the topics covered throughout the course. AssignmentIn the summer of 1992 I purchased my first used car. I began with a full tank of gas and 40056.0 miles on the car. The file mileage.txt contains my records for gas purchases. The first few lines of the file are included below: Date Odomtr Gallon Price 6/22 40056.0 0.000 0.00 7/ 8 40459.2 10.003 10.69 7/ 8 40814.4 7.995 9.75 7/ 9 41140.9 7.274 7.99 As suggested by the column headings, the first column indicates the date the purchase was made. The second column indicates the odometer reading at the time the car was filled. The third column indicates the number of gallons of gas purchased, and the fourth column indicates the price paid for the gas. Write a program that will read the data file, calculate a number of statistics, and display them on the screen. Your output should include the following statistics:
In addition, your program should produce the answers to the following questions:
Furthermore, you should include any additional statistics required for you to estimate the following:
Extra credit is available for students who calculate, estimate, or deduce additional interesting observations from the data. Your instructor will be solely responsible for deciding the level of extra credit awarded. Please check in advance if you have questions on the potential extra credit available. Assume the following: Winter = {Dec, Jan, Feb}, Spring = {Mar, Apr, May}, Summer = {Jun, Jul, Aug}, Fall = {Sep, Oct, Nov}. Project reportsIntermediate report (due 11:00pm, the day prior to week 9 lab)You should submit a design document that contains:
Program demonstration (due at the beginning of week 10 lab)You should be able to demonstrate your fully functional program at the beginning of lab. Final report (due 4:00pm, Friday of week 10)The final report should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report. Your report should include:
As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well. If you have any questions, consult the instructor. This page was created by Dr. Christopher C. Taylor, copyright 2000. |