I'm running a while loop to read from an input file and write to an output file. The program appears to work perfectly except the final line is read twice. I believe this code is supposed to loop until the file has nothing left to be read and closes.
while (my_input_file) {
my_output_file << getStudentID() << " " << studentScores() << " ";
totalScore();
calculatePercentage();
calculateGrade();
}