Grade point average (GPA) calculator
Note that I am completely unfamiliar with the american(?) grade system and GPAs -- I am reviewing the coding style and approach, not whether or not the solution is correct.

General notes:


Your GPA class is not really a class. It's actually just a function. It could just as well be implemented as double calculateGPA(std::vector&lt;std::pair&lt;char, unsigned&gt;&gt;). Beware of the golden hammer, especially when it comes to classes.
You can use std::tolower() to halve the size of your switch.
vector comes after utility in the alphabet :-)
C++11 allows writing &gt;&gt; in nested templates.
Your program won't compile: totalGradePoints is called sumGradePoints.
You can probably use float instead of double.
Make the local variables in calculateGPA() floating point numbers from the start, and drop the cast.
obj should be called gpa or something like that.
Write unit tests.





  Are plain types okay for the letter grades and credit hours, or could they be public typedefs?


Either is fine. Using a typedef makes the intent of a variable a bit clearer. This added distinction between types could help the developer realizing he or she is making a mistake. However, a typedef is sadly just a type alias and does not create a new type! In other words, you do not get any type-safety benefits of doing so.

To get full type safety, you would need to create a (templated) wrapper class around the types in question. Doing so would be a nice exercise when you start to learn about templates.




  Should operator&lt;&lt; need to call calculateGPA(), or should I create a private accessor and have that called?  In order to maintain encapsulation, I'll need to keep operator&lt;&lt; as a friend.


I would cache the result of calculateGPA and provide an accessor to it. Have operator&lt;&lt; call that accessor. This means that your class would need to invalidate the cached value whenever grades is modified.




  Is the for-loop in calculateGPA() ideal for this purpose, or are there one or more STL functions that can do the same thing but more cleanly?


The for loop is sufficiently short and sweet, and makes just a single pass (unlike most other solutions I can think of). You could always use std::accumulate and a lambda, but you would have to do so for both sumCreditPoints and sumGradeHours.

Am I guilty of converting you to the const&amp; style? :-)