Code:
Dim mark(6) As
Integer
Private Sub
Command1_Click()
For i = 1 To 6
mark(i) =
Val(InputBox("Enter Marks"))
List1.AddItem (mark(i))
Next i
End Sub
Private Sub
Command2_Click()
Dim total As
Integer, per As Single
total = 0
For i = 1 To 6
total = total +
mark(i)
Next i
Text1.Text = total
per = total / 600 *
100
Text2.Text = per
& "%"
If per > 90 Then
Text3.Text =
"A+"
ElseIf per > 80
And per < 90 Then
Text3.Text =
"A"
ElseIf per > 70
And per < 80 Then
Text3.Text =
"B+"
ElseIf per > 60
And per < 70 Then
Text3.Text =
"B"
ElseIf per > 50
And per < 60 Then
Text3.Text =
"C+"
ElseIf per > 40
And per < 50 Then
Text3.Text =
"C"
ElseIf per > 30
And per < 40 Then
Text3.Text =
"D+"
ElseText3.Text =
"Failed"
End If
End Sub
Private Sub
Command3_Click()
Text1.Text = Clear
Text2.Text = Clear
Text3.Text = Clear
List1.Clear
End Sub
No comments:
Post a Comment