First, I cannot figure out how to use getline to read data such as the following past the first name and last name. I can get the first name and last name to print of the first student, but after that it only prints the first name and zeros of the id and scores of the second student and does not even print the rest of the students
Jon Doe
2838596
93 85
Jane Smith
9493853
87 91
Kaitlyn Davies
4968493
80 78
Amanda Warden
5347646
67 98
Also I do not know how to print the letter grade of each score beside the number grade
We must have functions that read the data, determine the grade, compute the average of the class, and print the results
st is a struct, correct? Could we get it's contents?
As for printing the letter grade, what problems are you having with that, exactly? EDIT: Aren't you storing the letter in a char from which you could access and print it just like that?
-Albatross
P.S.- Am I the only one who finds st[i] a little bit funny?
For your struct, insert a variable named char letter; (for example, but it has to be a char). Assuming you know how to compute the letter grade, after computing it you can put it into your char that you have in your struct, and then just read it out along with all the other data.
If you are forbidden from modifying your struct, then create a char[] outside of any functions (some will say this is evil, but...)
Speaking of which, you should declare your avg variables outside of all the functions as well.
@Anyone who thinks global variables are evil: Ridiculously long lists of arguments are evil too, no? Which makes the code harder to follow: a few variables declared on the outside of all the functions, or a function or two that requires so many arguments that it's hard to keep track of what goes where?