Hello,
Recently I have been writing a basic grade tracking program. Basically it read the grades and computes a sum. Then it saves the grades that way you can search and find all the grades. However my search feature can never return the last grade or name saved. The code is very messy but I am only interested in why it won't return the last item in the vector. I think it's a problem with the range.
index <= name.size()
The most common mistake - you will be accessing vector[size()] on the last loop, which of course, does not exist.
Also, why are you using vector<double>::size_type? I understand that it will probably be the same, but consistency is essence. It makes more sense to use vector<string> because you are searching for a name, not a grade. Nothing wrong, just pointing it out.
Other than that, I don't immediately see anything wrong - could you post your test data (the names of the students you are using?)