TUGAS 2.8 MEMBUAT HURUF MUTU OTOMATIS LENGKAP

TUGAS BAHASA PEMROGRAMAN 2.8


TUGAS 2.8



Private Sub cbonpm_Click()
Dim nama, jurusan As String

Select Case cbonpm.Text
Case "17100039"
nama = "AMRI MUSLIM"
jurusan = "Sistem Informasi"
Case "17100042"
nama = "RISKI APRI YANDI"
jurusan = "Sistem Informasi"
Case "17100045"
nama = "ANDI ORLANDO"
jurusan = "Sistem Informasi"
Case "17100055"
nama = "SYAHRONI SAPUTRA"
jurusan = "Manajemen Informatika"
Case "17100067"
nama = "RAMDON MALIK"
jurusan = "Sistem Informasi"
End Select
txtnama.Text = nama
txtjr.Text = jurusan
txtnq.SetFocus
End Sub

Private Sub cmdbatal_Click()
cbonpm = ""
txtnama = ""
txtjr = ""
txtnq = ""
txtnt = ""
txtuts = ""
txtuas = ""
txtna = ""
txthm = ""
cbonpm.SetFocus
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdproses_Click()
Dim Na As Integer
Dim HM As String
Quis = Val(txtnq.Text)
Tugas = Val(txtnt.Text)
UTS = Val(txtuts.Text)
UAS = Val(txtuas.Text)
Na = Val(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 Form_Load()
cbonpm.AddItem "17100039"
cbonpm.AddItem "17100042"
cbonpm.AddItem "17100045"
cbonpm.AddItem "17100067"
cbonpm.AddItem "17100055"
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 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(txtnq.Text)
Tugas = Val(txtnt.Text)
UTS = Val(txtuts.Text)
UAS = Val(txtuas.Text)
Na = Val(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 If
End Sub