•Before reading the scores in and displaying, print a header (example is in purple in the image below).
•Create a showScore() function to display a label and the score count and score value. (2 arguments: count and score).
•After the average is calculated, use the average as an argument in a function named getGrade() to determine a letter grade.
A 90-100
B 80- 89
C 70- 79
D 60- 69
F 0 - 59
•Update the summary function to display the letter grade in addition to the rest of the summary data.
so far I can read the scores in from my file just fine. the only part I am having with is creating the functions "showScore()" and "getGrade()". I am not sure how to create them and more importantly I am not sure how to implement them into my code to make it work and run the way I want. and I also do not know in what part of my program to put them in. I know one goes in the loop, but where? any help from anyone would be so much appreciated!! Thank you!
heres my code so far
I think you want getGrade() to return the letter grade, not print it. Then line 94 could be written as cout << over4 << "Grade: " << getGrade(average) << endl;
As a general rule, it's usually a good idea to separate computing data from displaying it.