Apr 20th, 2011, 10:42 PM
GPA Calculator Code Help
I need to create a program to determine a student's GPA. The user should enter the grade (A, B, C, D, or F) and the number of credit hours for a course, and then click on the Record This Course button. The user should then repeat this process for all their courses. After all the course have been recorded, the user should click on the Calculate GPA button. A function procedure should be used to calculate the quality points for a course.
This is my code. Yes, I realize that it doesn't work at all and that there are for sure many mistakes. I also don't have a function procedure like I need.
Specifically, I have not been able to get a handle of how to add up the grade values, and course hours cumulatively.
I'm completely lost. Any help would be very much appreciated =)
Public Class Form1
Dim Credits As Double
Dim CumulativeGPA As Double
Private Sub btnRecord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRecord.Click
CumulativeGPA += CourseGrade()
Credits += CDbl(txtCredits.Text)
If txtGrade.Text = "A" Then
CumulativeGPA += 4
If txtGrade.Text = "B" Then
CumulativeGPA += 3
If txtGrade.Text = "C" Then
CumulativeGPA += 2
If txtGrade.Text = "D" Then
CumulativeGPA += 1
If txtGrade.Text = "F" Then
CumulativeGPA += 0
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Dim totalGPA As Double = CumulativeGPA / Credits
txtTotalGPA.Text = CStr((totalGPA))
Apr 22nd, 2011, 05:39 AM
Re: GPA Calculator Code Help
i am unable to visualize your project.
be specific like this
The user should enter the grade (A, B, C, D, or F)
? where ?
number of credit hours for a course
user should then repeat this process for all their courses.
GPA formula ?
the user should click on the Calculate GPA
by the above i can assume that
you are having 2 text boxes + 1 or 2 command buttons
on button click you need to display the GPA output basing on values in 2 text boxes ?
Click Here to Expand Forum to Full Width
Survey posted by VBForums.