Program 4. Mencari Huruf Mutu Mahasiswa menggunakan *enter

tugasbaru4.1

tugasbaru4.2

Private Sub cbonpm_Click()

Dim nama, jurusan, HM As String

 

Select Case cbonpm.Text

Case “15100030”

nama = “HERMIN SUKMIATI”

jurusan = “Sistem Informasi”

Case “15100031”

nama = “ARTIKA KUSTRIYANI”

jurusan = “Sistem Informasi”

Case “15100007”

nama = “DESI YULIANTI”

jurusan = “Manajemen Informatika”

End Select

txtNM.Text = nama

txtjurusan.Text = jurusan

txtquis.SetFocus

 

End Sub

 

Private Sub cmdbatal_Click()

cbonpm.SetFocus

cbonpm.Text = “”

txtNM.Text = “”

txtjurusan.Text = “”

txtquis.Text = “”

txttugas.Text = “”

txtuts.Text = “”

txtuas.Text = “”

txtNA.Text = “”

txthm.Text = “”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdproses_Click()

Dim NA As Integer

Dim HM As String

QUIS = Val(txtquis.Text)

TUGAS = Val(txttugas.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 Form_Load()

cbonpm.AddItem “15100030”

cbonpm.AddItem “15100031”

cbonpm.AddItem “15100007”

 

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 txtuas_keypress(keyascii As Integer)

If keyascii = 13 Then

Dim NA As Integer

Dim HM As String

QUIS = Val(txtquis.Text)

TUGAS = Val(txttugas.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 If

End Sub

 

Private Sub txtuts_KeyPress(keyascii As Integer)

If keyascii = 13 Then

txtuas.SetFocus

End If

 

End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s