program 3

Untitled3

Private Sub Combonpm_Click()
Dim nama, jurusan, hm As String

Select Case ComboNpm.Text
Case “12100342”
nama = “sebastianus arianto”
jurusan = “sistem informasi”
Case “12100349”
nama = “ubadio pratama”
jurusan = “sistem informasi”
Case “12201099”
nama = “septiadi”
jurusan = “manajemen informatika”

End Select
Textnama.Text = nama
Textjurusan.Text = jurusan
Textnilaiquis.SetFocus

End Sub
Private Sub Commandbatal_Click()
ComboNpm.SetFocus
ComboNpm.Text = “”
Textnama.Text = “”
Textjurusan.Text = “”
Textnilaiquis.Text = “”
Textnilaitugas.Text = “”
Textuts.Text = “”
Textuas.Text = “”
Textnilaiakhir.Text = “”
Texthm.Text = “”

End Sub

Private Sub Commandkeluar_Click()
End

End Sub

Private Sub Commandproses_Click()
Dim nilaiakhir As Integer
Dim hm As Integer
quis = Val(Textnilaiquis.Text)
tugas = Val(Textnilaitugas.Text)
uts = Val(Textuts.Text)
uas = Val(Textuas.Text)
nilaiakhir = (quis + tugas + uts + uas) / 4
Textnilaiakhir.Text = nilaiakhir

Select Case Textnilaiakhir.Text
Case Is > 80
hm = “A”
Case Is > 70
hm = “B”
Case Is > 60
hm = “C”
Case Is > 50
hm = “D”
Case Is > 40
hm = “E”
End Select
Texthm.Text = hm

End Sub

Private Sub Form_Load()
ComboNpm.AddItem “12100342”
ComboNpm.AddItem “12100349”
ComboNpm.AddItem “12201099”

End Sub
Private Sub Textnilaiquis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textnilaitugas.SetFocus
End If

End Sub
Private Sub Textnilaitugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textuts.SetFocus
End If

End Sub

Private Sub Textuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Textuas.SetFocus
End If

End Sub

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s