I am trying to figure out how to begin this program for my CSCI course,
the guidelines are as follows:
You are to write a program to calculate the average miles per gallon over a period of time. The input file contains of an unknown number of lines of the form odometer-reading-gallons-pumped. Here's a sample file:
29092 12.3
29412 11.9
29805 10.4
30177 11.75
The output is to the screen and is to look as follows (for the above data file).
Miles Gallons Miles per Gallon
----- ------- ----------------
320 11.9 26.9
393 10.4 37.8
372 11.8 31.7
Note that the 12.3, the gallons pumped on the very first line, is not used for anything. (you can imagine that this is the gallons pumped to fill the car tank to start.)
The name of the input file is to be prompted for. Notice also the columnar format of the output. The gallons and miles per gallon are to output with one decimal place.
This is not a homework site. We won't do your homework for you. However we are always willing to help solve problems you encountered, correct mistakes you made in your code and answer your questions.
We didn't see your attempts to solve this problem yourself and so we cannot correct mistakes you didn't made and answer questions you didn't ask. To get help you should do something yourself and get real problems with something. If your problem is "I don't understand a thing", then you should go back to basics and study again. As it is impossible to find derivative of function without knowledge in arithmetic, you cannot do more complex tasks in programming without clear understanding of basics