r/programminghomework • u/SangM • Sep 28 '15
Single Control Break problem C++
I'm given a file called quiz.dat with student ids and quiz scores. EX: 10234 67, 10234 100, 10435 15, 10435 20, 10524 70,
I have to write a C++ program to loop through file and output student id and quiz average AFTER discarding highest score and lowest score. I have no idea how to start. Any recommendations?
1
Upvotes
View all comments
Show parent comment
1
u/tatu_huma Dec 17 '15
But you have to keep the association between the student ID and the scores. So using a map would be preferably, no? Especially since the map does the sorting for you.
Though if OP hasn't gotten to templated classes yet, then yeah arrays are the way to go.