[MSOE Homepage]

Dr. Taylor's MSOE homepage

Unix is a Four
Letter Word

My Photo Album

My Personal Homepage

CS-182 Main page

CS-182 -- Final Project: Gas Mileage

Winter Quarter 1999-2000



Electrical Engineering and Computer Science Department
Dr. Christopher C. Taylor

CC-27C, 277-7339

www.msoe.edu/~taylor/

Purpose

In 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.

Assignment

In 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:

  • Total number of miles between when the car was purchased and the last gas purchase.
  • Total amount of money spent on gas.
  • Average miles per gas purchase.
  • Average gas mileage.

In addition, your program should produce the answers to the following questions:

  • In which season have I driven the most/least?
  • In which season did I get the best/worst gas mileage?
  • In which season is the price of gas highest/lowest?
  • What is the average amount of gas purchased per gas station visit?
  • On which day of the month was the most gas purchased?
  • In which year was the most gas purchased?

Furthermore, you should include any additional statistics required for you to estimate the following:

  • The size of the car's gas tank.
  • The number of times I did not record a gas purchase.
  • The most/least number of miles traveled in one day.
  • The most/least number of miles traveled in one month.

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 reports

Intermediate report (due 11:00pm, the day prior to week 9 lab)

You should submit a design document that contains:

  • A discussion of your design process (you should include in your discussion a list of the statistics you will need to make the required estimates as well as an explanation of how you will use them to make the estimates).
  • A header file containing all of the function prototypes that you anticipate using (for the entire project).
  • Fully documented source code which produces all of the first set of statistics (the first four bullet items).
  • The output produced by your program.

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:

  • Purpose
  • Problem Statement
  • Procedure
    • The discussion of your design process (from the previously submitted report).
    • A discussion of any changes you needed to make to your original design as well as an explanation of why the changes were necessary.
  • Documented source code for the entire project. (Be sure to clearly indicate any changes made to the source code previously submitted in the design report.)
  • Discussion (program output, all of the required estimations (and how you estimated them), problems you encountered, etc.)
  • A summary of your activity log indicating how much time you spent on each phase of the assignment. Please report the time in the following categories:
    • Design
    • Coding
    • Debug (before you think it's working)
    • Test (after you think it's working)
    • Documentation
    • Other
  • Conclusions (what you learned, suggestions of how the project could have been better, things you would have done differently, etc.)

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.