Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

University Admissions Point system program not working right

$
0
0
The admissions offices of large Colleges often rely on a point system. A point system similar to the one in Figure 11.31 is used by a large state University. Write a program that displays the information in Figure 11.31 and allows an admission officer to determine whether an applicant should be admitted. The number in the brackets give the point count for each response. The Gpa Score displayed in the label to the right of the horizontal scoll bar should change (from 2.0 to 4.0 in steps of.1) as the user clicks on the bar's right arrow. The point Value in the brackets to the right of the label is 20 times the GPA. A total of a most 40 points can be earned for the responses below the line. the program should calculate the total score and then accept every applicant whose score is at least 100.

My problem is the scroll bar, and the option buttons don't stay checked. What am I doing wrong.


Option Explicit

Private Sub hsbXPoint_Change()
Dim gpaPoints As Integer
Dim Fraction As Integer

hsbXPoint.Max = 4#
hsbXPoint.Min = 2#
lblPoints.Caption = hsbXPoint.Value \ Fraction
gpaPoints = 20 * lblPoints.Caption

End Sub

Private Sub cmdCalculate_Click()
Dim gpaPoints As Integer, maxPoints As Integer, total As Single
Dim allPoints As Single
picScore.Cls

total = gpaPoints
'Possible points from the GPA Section
If optSat0.Value = 1 Then
total = total + 0
ElseIf optSat6.Value = 1 Then
total = total + 6
ElseIf optSat10.Value = 1 Then
total = total + 10
ElseIf optSat11.Value = 1 Then
total = total + 11
ElseIf optSat12.Value = 1 Then
total = total + 12
End If
'PossiblePoints from the High School Qulaity Section
If optSchool0.Value = 1 Then
total = total + 0
ElseIf optSchool2.Value = 1 Then
total = total + 2
ElseIf optSchool4.Value = 1 Then
total = total + 4
ElseIf optSchool6.Value = 1 Then
total = total + 6
ElseIf optSchool8.Value = 1 Then
total = total + 8
ElseIf optSchool10.Value = 1 Then
total = total + 10
End If
'Possible Points from the Difficulty of Curriculumn section
If optDif_4.Value = 1 Then
total = total - 4
ElseIf optDif_2.Value = 1 Then
total = total - 2
ElseIf optDif0.Value = 1 Then
total = total + 0
ElseIf optDif2.Value = 1 Then
total = total + 2
ElseIf optDif4.Value = 1 Then
total = total + 4
ElseIf optDif6.Value = 1 Then
total = total + 6
ElseIf optDif8.Value = 1 Then
total = total + 8
End If
'Possible Points for Geology
If chkState.Value = 1 Then
maxPoints = maxPoints + 10
ElseIf chkStateCounty.Value = 1 Then
maxPoints = maxPoints + 6
ElseIf chkUnderState.Value = 1 Then
maxPoints = maxPoints + 2
End If
'Possible Points for Alumni
If chkLegacy.Value = 1 Then
maxPoints = maxPoints + 4
ElseIf chkOther.Value = 1 Then
maxPoints = maxPoints + 1
End If
'Possible Points for written Essay
If OptGood.Value = 1 Then
maxPoints = maxPoints + 1
ElseIf optExcellent.Value = 1 Then
maxPoints = maxPoints + 2
ElseIf optOutstanding.Value = 1 Then
maxPoints = maxPoints + 4
End If
'Possible Points for Leadership and Service
If chkLState.Value = 1 Then
maxPoints = maxPoints + 1
ElseIf chkRegional.Value = 1 Then
maxPoints = maxPoints + 2
ElseIf chkNational.Value = 1 Then
maxPoints = maxPoints + 5
End If
'Possible Points for Miscellaneous
If optSocio.Value = 1 Then
maxPoints = maxPoints + 10
ElseIf optEthnic.Value = 1 Then
maxPoints = maxPoints + 20
ElseIf optMen.Value = 1 Then
maxPoints = maxPoints + 5
ElseIf optAthlete.Value = 1 Then
maxPoints = maxPoints + 20
ElseIf optProvo.Value = 1 Then
maxPoints = maxPoints + 20
End If
'Calculate and Show Result
If maxPoints >= 40 Then
maxPoints = 40
End If
allPoints = total + maxPoints
If allPoints >= 100 Then
picScore.Print "Total Score:", allPoints
picScore.Print
picScore.Print " Addmitted to University"
ElseIf allPoints <= 100 Then
picScore.Print "Total Score:", allPoints
picScore.Print
picScore.Print " Not enough points to addmit"
End If




End Sub



Private Sub lblTotal_Click()
lblTotal.Caption = total

End Sub

Viewing all articles
Browse latest Browse all 21090

Trending Articles