I'm still in my first C++ class and I'm stuck on my current homework. I have to program a simple grade book using vectors to store the student name & grades. So far, I can enter a name & 18 grades, but I can't get it to prompt for additional student names. I'm also a bit lost on how to retrieve the information once I have it in there. Right now, I'd be happy with a hint on how to enter more than one name with an associated set of grades.
Also....I'm not entirely sure the entered name is even associated with the grades. How do I know if I've connected the name vector and the grade set vector?
Thank you in advance!
The first thing that comes to mind when connecting the two is to use a struct or class that has both those elements in them and making one vector of that struct or class type.
That being said, how are you going to use this information? As soon as the getGrade function exits on line 19, that vector you just populated no longer exists because it goes out of scope. Same for all the studeNames you get on line 39. They all are destroyed at the end of the function.