Create a form with
1 text boxe , 3 Label , And 1 command button.
Label1 Caption- Mark
Label1 Caption- Great point
Label1 Caption- Leatter Great
Command buttons properties…………..
Command buttons 1 - Caption: Show Result
Add the following code to the form code module for the Formr1
_Click event:
Program code:
Private Sub Command1_Click()
Dim a
a = Val(Text1)
If a >= 80 And a <= 100 Then
Text2 = 5
Text3 = "A+"
ElseIf a >= 70 And a <= 79 Then
Text2 = 4
Text3 = "A"
ElseIf a >= 60 And a <= 69 Then
Text2 = 3.5
Text3 = "A-"
ElseIf a >= 50 And a <= 59 Then
Text2 = 3
Text3 = "B"
ElseIf a >= 40 And a <= 49 Then
Text2 = 2
Text3 = "C"
ElseIf a >= 33 And a <= 39 Then
Text2 = 1
Text3 = "D"
Else
Text2 = 0
Text3 = "F"
End If
End Sub
……………………………………………………
No comments:
Post a Comment