2.8
Private Sub cbonpm_click()
Dim nama, jurusan, hm As String
Select Case cbonpm.Text
Case "17100001"
nama = "Mardalena"
jurusan = "Sistem Informasi"
Case "17100002"
nama = "Bahadi Rhamadani"
jurusan = "Sistem Informasi"
Case "17100003"
nama = "Renaldi Zainal Arifin"
jurusan = "Sistem Informasi"
Case "17100033"
nama = "Robiyanto"
jurusan = "Sistem Informasi"
Case "17100032"
nama = "Dika adi pratama"
jurusan = "Sistem Informasi"
Case "17100023"
nama = "Danang pandu aji"
jurusan = "Sistem Informasi"
End Select
txtms.Text = nama
txtjn.Text = jurusan
txtqs.SetFocus
End Sub
Private Sub cmdbatal_Click()
cbonpm.SetFocus
cbonpm.Text = ""
txtms.Text = ""
txtjn.Text = ""
txtqs.Text = ""
txtnt.Text = ""
txtuts.Text = ""
txtuas.Text = ""
txtna.Text = ""
txthp.Text = ""
End Sub
Private Sub cmdproses_Click()
Dim na As Integer
Dim hp As String
quis = Val(txtqs.Text)
tugas = Val(txtnt.Text)
uts = Val(txtuts.Text)
uas = Val(txtuas.Text)
na = (quis + tugas + uts + uas) / 4
txtna.Text = na
Select Case txtna.Text
Case Is > 80
hp = "A"
Case Is > 70
hp = "B"
Case Is > 60
hp = "C"
Case Is > 50
hp = "D"
Case Is < 50
hp = "E"
End Select
txthp.Text = hp
End Sub
Private Sub cmdquit_Click()
Unload Me
End Sub
Private Sub Form_Load()
cbonpm.AddItem "17100001"
cbonpm.AddItem "17100002"
cbonpm.AddItem "17100003"
cbonpm.AddItem "17100033"
cbonpm.AddItem "17100032"
cbonpm.AddItem "17100023"
End Sub
Private Sub txtqs_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 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
Dim na As Integer
Dim hp As String
quis = Val(txtqs.Text)
tugas = Val(txtnt.Text)
uts = Val(txtuts.Text)
uas = Val(txtuas.Text)
na = (quis + tugas + uts + uas) / 4
txtna.Text = na
Select Case txtna.Text
Case Is > 80
hp = "A"
Case Is > 70
hp = "B"
Case Is > 60
hp = "C"
Case Is > 50
hp = "D"
Case Is < 50
hp = "E"
End Select
txthp.Text = hp
End If
End Sub
Tidak ada komentar:
Posting Komentar