Skip to content

2

SUTRIS VB

 

Private Sub cmdbatal_Click()

txtnama.SetFocus

txtnama.Text = “”

txtnpm.Text = “”

txtkel.Text = “”

txtjur.Text = “”

txtpro.Text = “”

txtthn.Text = “”

txtno.Text = “”

txtup.Text = “”

txtbipes.Text = “”

txtub.Text = “”

txtbipa.Text = “”

txttot.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

txtnama.SetFocus

txtnama.Text = “”

txtnpm.Text = “”

txtkel.Text = “”

txtjur.Text = “”

txtpro.Text = “”

txtthn.Text = “”

txtno.Text = “”

txtup.Text = “”

txtbipes.Text = “”

txtub.Text = “”

txtbipa.Text = “”

txttot.Text = “”

End Sub

 

Private Sub cmdproses_Click()

Dim eksekutif, reguler, tahun, jurusan, study, kelas, no As String

n = Left(txtnpm.Text, 1)

If n = “E” Or n = “e” Then

kelas = “Eksekutif”

bangunan = “1250000”

ElseIf n = “R” Or n = “r” Then

kelas = “Reguler”

bangunan = “1000000”

End If

property = “600000”

txtbipa.Text = property

txtub.Text = bangunan

tahun = “20” & Mid(txtnpm.Text, 3, 2)

txtthn.Text = tahun

txtkel.Text = kelas

n = Mid(txtnpm.Text, 5, 1)

If n = “1” Then

jurusan = “Sistem Informasi”

ElseIf n = “2” Then

jurusan = “Manajemen Informatika”

ElseIf n = “3” Then

jurusan = “Manajemen dan Kom. Akuntansi”

End If

txtjur.Text = jurusan

n = Mid(txtnpm.Text, 6, 2)

If n = “01” Or n = “00” Then

study = “Strata Satu”

biaya = “200000”

ElseIf n = “02” Then

study = “Diploma Tiga”

biaya = “150000”

ElseIf n = “03” Then

study = “Diploma Satu”

biaya = “150000”

End If

If kelas = “Eeksekutif” And study = “strata satu” Then

pendidikan = “1900000”

ElseIf kelas = “Eeksekutif” And study = “Diploma Tiga” Then

pendidikan = “1650000”

ElseIf kelas = “Eeksekutif” And study = “Diploma satu” Then

pendidikan = “1350000”

ElseIf kelas = “Reguler” And study = “Strata Satu” Then

pendidikan = “1500000”

ElseIf kelas = “Reguler” And study = “Diploma Tiga” Then

pendidikan = “1250000”

ElseIf kelas = “Reguler” And study = “Diploma Satu” Then

pendidikan = “1250000”

 

End If

txtkel.Text = kelas

txtpro.Text = study

txtbipes.Text = pendidikan

 

no = Right(txtnpm.Text, 3)

txtno.Text = no

txtup.Text = biaya

txttot.Text = Val(txtup.Text) + Val(txtbipes.Text) + Val(txtub.Text) + Val(txtbipa.Text)

 

 

End Sub

 

 

 

Private Sub txtnama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnpm.SetFocus

End If

End Sub

tugas3

 

 

 

  • Aplikasi perhitungan gaji

 

 

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub cmdulang_Click()

txtgapok = “”

txttunjangan = “”

txtpot = “”

txtgator = “”

txtgama = “”

End Sub

 

Private Sub txtgapok_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttunjangan.SetFocus

End If

End Sub

tugas 3

  • Perkalian dua bilangan

Private Sub cmdbersih_Click()

txtbil1.Text = “”

txtbil2.Text = “”

txthasil.Text = “”

End Sub

 

Private Sub cmdhitung_Click()

txthasil.Text = Val(txtbil1.Text) * Val(txtbil2.Text)

End Sub

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

 

tugas3

  • Huruf mutu mahasiswa

 

Private Sub cbonpm_Click()

Select Case cbonpm.Text

Case “12100015”

nama = “Agus Asngari”

jurusan = “Sistem Informasi”

Case “12100031”

nama = “Sutrisno”

jurusan = “Sistem Informasi”

Case “12100020”

nama = “Sinta Umpusinga”

jurusan = “Sistem Informasi”

End Select

txtnma.Text = nama

txtjrs.Text = jurusan

txtnq.SetFocus

End Sub

 

Private Sub cmdbatal_Click()

cbonpm.SetFocus

cbonpm.Text = “”

txtnma.Text = “”

txtjrs.Text = “”

txtnq.Text = “”

txtnt.Text = “”

txtuts.Text = “”

txtuas.Text = “”

txtna.Text = “”

txthm.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub cmdproses_Click()

quis = Val(txtnq.Text)

tugas = Val(txtnt.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”

Select Case txtna.Text

Case Is > 70

HM = “B”

Select Case txtna.Text

Case Is > 60

HM = “C”

Select Case txtna.Text

Case Is > 50

HM = “D”

Select Case txtna.Text

Case Is < 50

HM = “E”

End Select

txthm.Text = HM

End Sub

 

Private Sub Form_Load()

cbonpm.AddItem “12100015”

cbonpm.AddItem “12100031”

cbonpm.AddItem “12100020”

 

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 txttunjangan_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtpot.SetFocus

End If

End Sub

 

Gambar

tugas3