Here is suggested pseudocode for the button event handler:
public void btnSubmit_Click(object sender, EventArgs e)
{
Declare variables, initialize totalCreditHours and
totalGradePoints each to 0.0.
Initialize litDisplay with headings.
while(sr.Peek( ) > -1)
{
Read line.
Use Split method to obtain array of fields.
Obtain lastName, firstName, courseNumber, courseName,
creditHours, and grade from fields array.
(Use double.Parse to convert credit hours.)
if (first name from textbox matches first name from file &&
last name from textbox matches last name from file)
{
Update totalCreditHours.
if (grade == A)
{
Update totalGradePoints.
}
else if (grade == B)
{
Update totalGradePoints.
}
... continue with else if statements for C, D, and F.
litDisplay += string.Format( ... format string ...,
courseNumber, courseName, creditHours, grade);
}
Close input file.
}
Compute GPA.
Display GPA in textbox.
}