Okay so suppose that a text file grade.txt contains an unspecified number of scores. How would I program that reads the scores from the file and displays all the scores, their total and average? Scores are stored in the format of one score per line. Im having trouble with the whole #include <fstream> file and how to lay it all out in visual studio. Thank you in advance!
Open the file.
Begin loop
Read a score
If end of file
exit loop.
Display score
Add to total
Increment count of scores read
end loop
Compute average.
Display total and average