Using classes and objects to compute a students GPA
<p>Here's my code: </p>

<pre><code>class student:
    def __init__(self):
        self.totalSumOGrades = 0
        self.numberOGrades = 0

    def getAverageScore(self):
        return (self.totalSumOGrades / self.numberOGrades)

    def addGrade(self,grade):
        self.totalSumOGrades = str(grade)
        self.numberOGrades = self.numberOGrades + 1
        return (self.totalSumOGrades)


class GPA:
    def __init__(self,grade):
        self.grade = grade
        self.score = 0


    def gradesScore(self):
        gradeLetter = self.grade[0]
        gradeSign = ' '
        if (len(self.grade)) == 2:
            gradeSign = self.grade[1]

        if (gradeLetter == 'A'):
            self.score = 4
        elif (gradeLetter == 'B'):
            self.score = 3
        elif (gradeLetter == 'C'):
            self.score = 2
        elif (gradeLetter == 'D'):
            self.score = 1
        elif (gradeLetter == 'F'):
            self.score = 0

        if (gradeSign == '+'):
            self.score += 0.3
        elif (gradeSign == '-'):
            self.score -= 0.3


    def getScore(self):
        self.gradesScore()
        return self.score
</code></pre>

<p>I need both classes on one sheet. The problem I'm having is the argument that is being taken for class GPA is what "getScore" is calculating. I need it so the addGrade from class student adds a grade and I can have "getScore" calculate those grades instead. How do i fix this?</p>