I'm not sure of your proboem. Please provide sample input with expected output and observed output.
My best guess as to your problem is you can't add current average miles per gallop to previous average and divide that by number of "loops" to get overall average. Keep track of total miles and total gallons in addition to current miles and current gallons.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396