Home » Uncategorized » Tugas 3 Visual Basic Membuat Program

Tugas 3 Visual Basic Membuat Program

Download tugas VB 3.exe

Kode Program Tugas 3 Visual Basic:

Private Sub cmbnpm_Click()

Dim nama, jurusan As Variant

Select Case cmbnpm.Text

Case “10100001”

nama = “Fiqih Satria”

jurusan = “Sistem Informasi”

Case “10200002”

nama = “Heri Muriyanto”

jurusan = “Manajemen Informatika”

Case “10300003”

nama = “Nugroho Dwi Yus Panggi”

jurusan = “Teknik Informatika”

Case “10100004”

nama = “Eva Maulana”

jurusan = “Sistem Informasi”

Case “10200005”

nama = “Yusuf Cahyo Purnomo”

jurusan = “Manajemen Informatika”

Case “10300006”

nama = “Chandra Dautama”

jurusan = “Teknik Informatika”

Case “10100007”

nama = “Benedictus Probo Kuncoro”

jurusan = “Sistem Informasi”

Case “10200008”

nama = “Slamet Riadi”

jurusan = “Manajemen Informatika”

Case “10300009”

nama = “Darmaji”

jurusan = “Teknik Informatika”

Case “10100010”

nama = “Habib Bukhori”

jurusan = “Sistem Informasi”

End Select

txtnm.Text = nama

txtjr.Text = jurusan

txtnq.SetFocus

End Sub

Private Sub cmdbatal_Click()

cmbnpm = “”

txtnm = “”

txtjr = “”

txtnq = “”

txtnt = “”

txtuts = “”

txtuas = “”

txtna = “”

txthurufmutu = “”

txtnq.SetFocus

End Sub

Private Sub cmdkeluar_Click()

End

End Sub

Private Sub cmdproses_Click()

Dim Nilaiakhir As Integer

Dim hurufmutu As String

nilai1 = Val(txtnq.Text)

nilai2 = Val(txtnt.Text)

nilai3 = Val(txtuts.Text)

nilai4 = Val(txtuas.Text)

Nilaiakhir = (nilai1 + nilai2 + nilai3 + nilai4) / 4

txtna.Text = Nilaiakhir

If Val(txtna.Text) >= 76 Then

txthurufmutu.Text = “A”

End If

If Val(txtna.Text) < 76 Then

txthurufmutu.Text = “B”

End If

If Val(txtna.Text) < 66 Then

txthurufmutu.Text = “C”

End If

If Val(txtna.Text) < 56 Then

txthurufmutu.Text = “D”

End If

If Val(txtna.Text) < 46 Then

txthurufmutu.Text = “E”

End If

End Sub

Private Sub Form_Load()

cmbnpm.AddItem “10100001”

cmbnpm.AddItem “10200002”

cmbnpm.AddItem “10300003”

cmbnpm.AddItem “10100004”

cmbnpm.AddItem “10200005”

cmbnpm.AddItem “10300006”

cmbnpm.AddItem “10100007”

cmbnpm.AddItem “10200008”

cmbnpm.AddItem “10300009”

cmbnpm.AddItem “10100010”

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


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

follow on my twitter

Blog Stats

  • 42,490 hits
%d bloggers like this: