Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

Dim quiz1 As Integer

Dim quiz2 As Integer


Dim quiz3 As Integer

Label9.Caption = (Val(TextBox1.Text) + Val(TextBox2.Text) + Val(TextBox3.Text)) / 3


Label13.Caption = Val(Label9.Caption) * 0.4

If TextBox1.Text < 0 Or TextBox1.Text > 100 Then


Label9.Caption = "invalid number"
Label13.Caption = "invalid number"

ElseIf TextBox2.Text < 0 Or TextBox2.Text > 100 Then


Label9.Caption = "invalid number"
Label13.Caption = "invalid number"

ElseIf TextBox3.Text < 0 Or TextBox3.Text > 100 Then


Label9.Caption = "invalid number"
Label13.Caption = "invalid number"

End If

Dim le1 As Integer


Dim le2 As Integer
Dim le3 As Integer

Label10.Caption = (Val(TextBox4.Text) + Val(TextBox5.Text) + Val(TextBox6.Text)) /


3
Label14.Caption = Val(Label10.Caption) * 0.6

If TextBox4.Text < 0 Or TextBox4.Text > 100 Then


Label10.Caption = "invalid number"
Label14.Caption = "invalid number"

ElseIf TextBox5.Text < 0 Or TextBox5.Text > 100 Then


Label10.Caption = "invalid number"
Label14.Caption = "invalid number"

ElseIf TextBox6.Text < 0 Or TextBox6.Text > 100 Then


Label9.Caption = "invalid number"
Label13.Caption = "invalid number"
End If
End Sub

Label16.Caption = Val(Label13.Caption) + Val(Label14.Caption)

If Label13.Caption = "invalid number" Then


Label18.Caption = 0
Label20.Caption = 0

ElseIf Label14.Caption = "invelid number" Then


Label18.Caption = 0
Label20.Caption = 0

ElseIf Label16.Caption = 100 Then


Label18.Caption = 1
Label20.Caption = "PASSED"

ElseIf Label16.Caption >= 98 Then


Label18.Caption = 1.25
Label20.Caption = "PASSED"

ElseIf Label16.Caption >= 95 Then


Label18.Caption = 1.5
Label20.Caption = "PASSED"

ElseIf Label16.Caption >= 92 Then


Label18.Caption = 1.75
Label20.Caption = "PASSED"

ElseIf Label16.Caption >= 89 Then


Label18.Caption = 2#
Label20.Caption = "PASSED"

ElseIf Label16.Caption >= 85 Then


Label18.Caption = 2.25
Label20.Caption = "PASSED"

ElseIf Label16.Caption >= 82 Then


Label18.Caption = 2.5
Label20.Caption = "PASSED"

ElseIf Label16.Caption >= 79 Then


Label18.Caption = 2.75
Label20.Caption = "PASSED"

ElseIf Label16.Caption >= 75 Then


Label18.Caption = 3#
Label20.Caption = "PASSED"

ElseIf Label16.Caption < 75 Then


Label18.Caption = 5#
Label20.Caption = "FAILED"

End If

You might also like