Tugas 3.1
Private Sub Form_Load()
cbonpm.AddItem "18100033"
cbonpm.AddItem "18100001"
cbonpm.AddItem "18100018"
cbonpm.AddItem "18100038"
cbonpm.AddItem "18100017"
End Sub
Private Sub txtnq_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnt.SetFocus
End If
End Sub
Private Sub txtnt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtuts.SetFocus
End If
End Sub
Private Sub txtna_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim NA As Integer
Dim HM As String
QUIS = Val(Txtquis)
TUGAS = Val(Txttugas)
UTS = Val(Txtuts)
UAS = Val(Txtuas)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtna.Text = NA
Select Case txtna
Case Is = 100
HM = "A"
Case Is >= 80
HM = "A"
Case Is >= 70
HM = "B"
Case Is >= 60
HM = "C"
Case Is >= 50
HM = "D"
Case Is <= 49
HM = "E"
End Select
txthm.Text = HM
End If
End Sub
Private Sub Txtquis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttugas.SetFocus
End If
End Sub
Private Sub Txttugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtuts.SetFocus
End If
End Sub
Private Sub txtuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtuas.SetFocus
End If
End Sub
Private Sub txtuas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtna.SetFocus
Dim NA As Integer
Dim HM As String
QUIS = Val(Txtquis)
TUGAS = Val(Txttugas)
UTS = Val(Txtuts)
UAS = Val(Txtuas)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtna.Text = NA
End If
End Sub
Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As String
Select Case cbonpm
Case "18100038"
nama = "ZAHRA REVITA"
jurusan = "Sistem Informasi"
Case "18100017"
nama = "INDRA ISNAWAN"
jurusan = "Manajemen Informatika"
Case "18100033"
nama = "SERINA NOVEGA D"
jurusan = "Sistem informasi"
Case "18100033"
nama = "SAKIR KECIL"
jurusan = "Tehnik Informatika"
Case "16400196"
nama = "SUKIJAN"
jurusan = "MANAGEMENT SISTEM INFORMASI"
End Select
Txtnm = nama
Txtjurusan = jurusan
Txtquis.SetFocus
End Sub
Private Sub Cmdbatal_Click()
cbonpm.SetFocus
cbonpm = ""
Txtnm = ""
Txtjurusan = ""
Txtquis = ""
Txttugas = ""
Txtuts = ""
Txtuas = ""
txtna = ""
txthm = ""
End Sub
Private Sub Cmdkeluar_Click()
Unload Me
End Sub
Private Sub Cmdproses_Click()
Dim NA As Integer
Dim HM As String
QUIS = Val(Txtquis)
TUGAS = Val(Txttugas)
UTS = Val(Txtuts)
UAS = Val(Txtuas)
NA = (QUIS + TUGAS + UTS + UAS) / 4
txtna.Text = NA
Select Case txtna
Case Is = 100
HM = "A"
Case Is >= 80
HM = "A"
Case Is >= 70
HM = "B"
Case Is >= 60
HM = "C"
Case Is >= 50
HM = "D"
Case Is <= 49
HM = "E"
End Select
txthm.Text = HM
End Sub

Komentar
Posting Komentar