Page 52 - Programming VB.NET
P. 52
48 Chapter 4: Control Program Flow
Private Sub btnif_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Dim markah As Integer
markah = txtmark.Text
If markah >= 80 And markah <= 100 Then
lblgrade.Text = "You got A"
ElseIf markah >= 60 And markah < 79 Then
lblgrade.Text = "You got B"
ElseIf markah >= 50 And markah < 59 Then
lblgrade.Text = "You got C"
ElseIf markah >= 40 And markah < 49 Then
lblgrade.Text = "You got D"
ElseIf markah >= 0 And markah < 39 Then
lblgrade.Text = "FAIL"
Else
lblgrade.Text = "WRONG INPUT"
End If
End Sub