In this code, I think I have it nearly right, but it isn't calculating the way I need it to.
The code should ignore the first grade, only if the second is higher for a single grade.

Here is the code I've constructed for it, but when I run the program it will always calculate the second grade irregardless of its value.

```
double ComputeGPA()
    {
        if (Count == 0) return 0;
        bool bForgiven = false;
        int nCourseCount = 0;
        int i;
        double gpa = 0.0;
        double gpaToAdd;
        for (i = 0; i < this.Count; i++)
        {
            gpaToAdd = 0.0; 
            Course c = this[i]; 
            gpaToAdd = GradePoints(c.Grade);
            if (c.Grade == null || c.Grade == "W") continue;
            if (bForgiven == false)
            {
                int nRep = FindCourse(c.Number, i + 1);
                if (nRep > 0)
                {
                    Course x = this[i + 1];
                    if(GradePoints(this[nRep].Grade > GradePoints(c.Grade)))
                        gpaToAdd = GradePoints(x.Grade); 
                    // This means we forgive only one grade
                    bForgiven = true;
                    continue;
                }
            }
        gpa = gpa + GradePoints(c.Grade);
        nCourseCount++;
    }
    //If we've forgiven a grade , we divide by one less course
    gpa = (nCourseCount > 0) ? gpa / nCourseCount : 0.0;
    return gpa;
}

```

I also have these functions to work with it:

```
public int FindCourse(int Number, int nStart)
       {
           int i;
           for (i = nStart; i< this.Count; i++)
           {
               Course c = this[i];
               if (c.Number == Number) return i;
           }
           return -1; // Signifies no course was found
       }

public int FindCourse(int Number)
{
    return FindCourse(Number, 0);
}

```

What is the construct that will allow this to work?

Thank you,
Travis

Here are some test inputs:

```
TestTranscript();
    }
    static void TestTranscript()
    {
        Transcript trans = new Transcript();
        trans.Add(new Course(1, 3113, "A", false));
        trans.Add(new Course(1, 3232, "A", false));
        trans.Add(new Course(1, 4212, "A", false));
        trans.Add(new Course(1, 3113, "F", false));
        trans.Add(new Course(1, 4220, "A", false));
        trans.Add(new Course(1, 4234, "A", false));
        trans.Add(new Course(1, 4300, "A", false));
        TranscriptForm frm = new TranscriptForm("Test Transcript", trans);
        frm.ShowDialog();
        MessageBox.Show("GPA is computed to be " + trans.GPA.ToString());
    }

```

And these are their corresponding values per letter:

```
 public static double GradePoints(string grade)
    {
        switch (grade)
        {
            case "A":
            case "A+":
                return 4.0;
            case "A-":
                return 3.7;
            case "B+":
                return 3.3;
            case "B":
                return 3.0;
            case "B-":
                return 3.7;
            case "C+":
                return 2.3;
            case "C":
                return 2.0;
            case "C-":
                return 1.7;
            case "D+":
                return 1.3;
            case "D":
                return 1.0;
            case "D-":
            default:
                return 0.0;
        }
    }

```