I am trying to write a program that calculates the GPA from 7 classes the student has taken. This is purely practice for me as this is what we are going over in class, but the teacher is not going to deep into it and I am trying better myself at it. The problem is that when I try to calulate the gpa, it keeps saying I am dividing by zero. Heres the code:
Public
txtCourse1.Text =
txtHour1.Text =
txtCourse1.SelectAll()
txtHour1.SelectAll()
MessageBox.Show(
txtCourse1.Clear()
txtCourse2.Clear()
txtCourse3.Clear()
txtCourse4.Clear()
txtCourse5.Clear()
txtCourse6.Clear()
txtCourse7.Clear()
txtHour1.Clear()
txtHour2.Clear()
txtHour3.Clear()
txtHour4.Clear()
txtHour5.Clear()
txtHour6.Clear()
txtHour7.Clear()
cboGrade1.SelectedItem = -1
cboGrade2.SelectedItem = -1
cboGrade3.SelectedItem = -1
cboGrade4.SelectedItem = -1
cboGrade5.SelectedItem = -1
cboGrade6.SelectedItem = -1
cboGrade7.SelectedItem = -1
txtCourse1.Focus()
lblGPA.Text =
lblTotal.Text =
sngTotalGPA = intFinalGPA
decCreditHours =
lblTotal.Text = decCreditHours
lblGPA.Text = FormatNumber(decCreditHours / sngTotalGPA)
intExit = Windows.Forms.DialogResult.No
intGrade1 = 4
intGrade1 = 3
intGrade1 = 2
intGrade1 = 1
intGrade1 = 0
intFinalGPA = (decCreditHours / (intGrade1 + intGrade2 + intGrade3 + intGrade4 + intGrade5 + intGrade6 + intGrade7))
End