The GPA is calculated as a weighted average of the grades, when the number of credit/hours is the weight and the numeric grade is taken from the GPA table.

The GPA is equal to the sum of the product of the credit hours weight (w) times the grade (g):