Tugas 2.8 Huruf Mutu Mahasiswa Stmik Pringsewu Menggunakan keypress
Berikut Source Codenya:
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 "17100004"
nama = "Eka Kartika"
jurusan = "Sistem Informasi"
Case "17100006"
nama = "Rosi elvia"
jurusan = "Sistem Informasi"
Case "17100008"
nama = "M.Galih algofur"
jurusan = "Sistem Informasi"
Case "17100010"
nama = "Novia Anggraini"
jurusan = "Sistem Informasi"
Case "17100011"
nama = "Ariansyah"
jurusan = "Sistem Informasi"
Case "17100012"
nama = "Dimas Apringga"
jurusan = "Sistem Informasi"
Case "17100013"
nama = "Irmanida Siswanti"
jurusan = "Sistem Informasi"
End Select
txtmhs.Text = nama
txtjur.Text = jurusan
txtquis.SetFocus
End Sub
'renaldi Zainal arifin
Private Sub cmdbatal_Click()
cbonpm.SetFocus
cbonpm.Text = ""
txtmhs.Text = ""
txtjur.Text = ""
txtquis.Text = ""
txttgs.Text = ""
txtuts.Text = ""
txtuas.Text = ""
txtna.Text = ""
txthm.Text = ""
End Sub
Private Sub cmdproses_Click()
Dim na As Integer
Dim hm As String
quis = Val(txtquis.Text)
tugas = Val(txttgs.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
hm = "A"
Case Is > 70
hm = "B"
Case Is > 60
hm = "C"
Case Is > 50
hm = "D"
Case Is < 50
hm = "E"
End Select
txthm.Text = hm
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 "17100004"
cbonpm.AddItem "17100006"
cbonpm.AddItem "17100008"
cbonpm.AddItem "17100010"
cbonpm.AddItem "17100011"
cbonpm.AddItem "17100012"
cbonpm.AddItem "17100013"
End Sub
Private Sub txtquis_keypress(keyascii As Integer)
If keyascii = 13 Then
txttgs.SetFocus
End If
End Sub
Private Sub Txttgs_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 hm As String
quis = Val(txtquis.Text)
tugas = Val(txttgs.Text)
uts = Val(txtuts.Text)
uas = Val(txtuas.Text)
na = (quis + tugas + uts + uas) / 4
txtna.Text = na
'Renaldi zainal arifin
Select Case txtna.Text
Case Is > 80
hm = "A"
Case Is > 70
hm = "B"
Case Is > 60
hm = "C"
Case Is > 50
hm = "D"
Case Is < 50
hm = "E"
End Select
txthm.Text = hm
End If
End Sub
0 komentar:
Posting Komentar