In: Computer Science
<<<<<<<<<<<<sample code run >>>>>>>>>>>>
last line is printed 2 times because it gets called 2 times first for end of line call then end of file call to avoid use
while (inFile >> bmi) instead of while (!inFile.eof())
and remove inFile >> bmi; line inside the while loop
<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>