Dim Total As Integer
Private Sub Hitung_Total()
Total = (Val(Text1.Text) * 0.1) + (Val(Text2.Text) * 0.2) + (Val(Text3.Text) * 0.3) + (Val(Text4.Text) * 0.4)
LblTotal.Caption = Total
End Sub
Private Sub Hitung_Grade()
Dim Grade As String
If Total > 80 Then
Grade = "A"
Else
If Total > 70 Then
Grade = "B"
Else
If Total > 60 Then
Grade = "C"
Else
If Total > 50 Then
Grade = "D"
Else
Grade = "E"
End If
End If
End If
End If
LblGrade.Caption = Grade
End Sub
Private Sub Command1_Click()
If MsgBox("Anda Yakin", vbYesNo, "Ok") = vbYes Then
End
End If
End Sub
Private Sub Text1_Change()
Call Hitung_Total
Call Hitung_Grade
End Sub
Private Sub Text2_Change()
Call Hitung_Total
Call Hitung_Grade
End Sub
Private Sub Text3_Change()
Call Hitung_Total
Call Hitung_Grade
End Sub
Private Sub Text4_Change()
Call Hitung_Total
Call Hitung_Grade
End Sub
0 komentar:
Posting Komentar