The statement: inFile.open("E:\\Mileagelog.txt"); should not be inside the loop. Assuming it succeeds the first time, on the second pass, it will fail, and set the fail flag for the stream, that is inFile.fail() == true
However, the eof flag will not be set. In fact, testing for eof() is almost always erroneous and is best avoided.
int numberOfLines = 0;
double runningTotal = 0;
while (inFile >> currentValue) // read from the file
runningTotal += currentValue;
// calculate & return the average
return runningTotal / numberOfLines;
One more thing, many of the comments were superfluous and make the code harder to read. The use of suitable names for variables, proper indentation and so on should make most things clear without the need for comments.