New Program

TUGAS 1

db1

Private Sub cbogol_Click()

Dim GOLONGAN, Gajipokok, Tunjangan, PAJAK, TOTAL As Variant

GOLONGAN = cbogol

Select Case GOLONGAN

Case “I”

Gajipokok = “1500000”

Tunjangan = “150000”

Case “II”

Gajipokok = “2000000”

Tunjangan = “200000”

Case “III”

Gajipokok = “2500000”

Tunjangan = “250000”

Case “IV”

Gajipokok = “3000000”

Tunjangan = “300000”

End Select

txtgp = Gajipokok

txttunj = Tunjangan

PAJAK = (Gajipokok + Tunjangan) * 0.1

txtpajak = PAJAK

TOTAL = Gajipokok + Tunjangan – PAJAK

txttotal = TOTAL

End Sub

 

Private Sub cmdbatal_Click()

txtnidn.SetFocus

txtnidn.Text = “”

txtnm.Text = “”

cbogol.Text = “pilih golongan”

txtgp.Text = “”

txttunj.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdlg_Click()

txtnidn.SetFocus

txtnidn.Text = “”

txtnm.Text = “”

cbogol.Text = “pilih golongan”

txtgp.Text = “”

txttunj.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub Command1_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub Command2_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

End Sub

 

Private Sub Command3_Click()

txtnidn.SetFocus

txtnidn.Text = “”

txtnm.Text = “”

cbogol.Text = “pilih golongan”

txtgp.Text = “”

txttunj.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub Command4_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub Form_Load()

cbogol.AddItem “I”

cbogol.AddItem “II”

cbogol.AddItem “III”

cbogol.AddItem “IV”

End Sub

 

Private Sub txtnidn_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnm.SetFocus

End If

End Sub

 

Private Sub txtnm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

cbogol.SetFocus

End If

End Sub

 

TUGAS 2

npm.PNG

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

 

End Sub

 

Private Sub cmdbatal_Click()

txtnm.SetFocus

txtnm.Text = “”

txtnpm.Text = “”

txtjuru.Text = “”

txtps.Text = “”

txtmasuk.Text = “”

txtno.Text = “”

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub cmdlagi_Click()

txtnm.SetFocus

txtnm.Text = “”

txtnpm.Text = “”

txtjuru.Text = “”

txtps.Text = “”

txtmasuk.Text = “”

txtno.Text = “”

End Sub

 

Private Sub cmdproses_Click()

Dim A As String

txtmasuk.Text = “20” & Left(txtnpm.Text, 2)

A = Mid(txtnpm, 3, 1)

If A = “1” Then

txtjuru = “Sistem Informasi”

txtps = “Strata Satu”

ElseIf A = “2” Then

txtjuru = “Tekhnik Informatika”

txtps = “Diploma Empat”

ElseIf A = “3” Then

txtjuru = “Manajemen Informatika”

txtps = “Diploma Tiga”

ElseIf A = “4” Then

txtjuru = “Komputer Akuntansi”

txtps = “Diploma Dua”

End If

txtmasuk = Left(txtnpm, 2)

txtno = Right(txtnpm, 4)

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

 

End Sub

 

Private Sub txtnm_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnpm.SetFocus

End If

End Sub

 

TUGAS 3

entrilaptop.PNG

 

Private Sub CboKode_Click()

Dim Merk, Satuan As Variant

Select Case CboKode.Text

Case “Apple MC965 MacBook Air”

Merk = “Apple MacBook Air MC965”

Satuan = 12800000

Case “Apple MC966 MacBook Air”

Merk = “Apple MacBook Air MC966”

Satuan = 15800000

Case “Apple MC968 MacBook Air”

Merk = “Apple MacBook Air MC965”

Satuan = 9900000

Case “Apple MC969 MacBook Air”

Merk = “Apple MacBook Air MC969”

Satuan = 11900000

Case “Apple MC700 MacBook Pro”

Merk = “Apple MacBook Pro MC700”

Satuan = 10800000

Case “Apple MC721 MacBook Pro”

Merk = “Apple MacBook Pro MC721”

Satuan = 15900000

Case “Apple MC723 MacBook Pro”

Merk = “Apple MacBook Pro MC723”

Satuan = 19300000

Case “Apple MC724 MacBook Pro”

Merk = “Apple MacBook Pro MC724”

Satuan = 13700000

Case “Apple MC311 MacBook Pro”

Merk = “Apple MacBook Pro MC311”

Satuan = 24200000

Case “Apple MC313 MacBook Pro”

Merk = “Apple MacBook Pro MC313”

Satuan = 11900000

Case “Apple MC314 MacBook Pro”

Merk = “Apple MacBook Pro MC314”

Satuan = 14700000

Case “Apple MC318 MacBook Pro”

Merk = “Apple MacBook Pro MC318”

Satuan = 17600000

Case “Apple MC322 MacBook Pro”

Merk = “Apple MacBook Pro MC322”

Satuan = 21300000

Case “Apple MC965 MacBook Pro”

Merk = “Apple MacBook Pro MC965”

Satuan = 12800000

Case “Apple MC966 MacBook Pro”

Merk = “Apple MacBook Pro MC966”

Satuan = 15800000

End Select

TxtMerk.Text = Merk

TxtHS.Text = Satuan

End Sub

 

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub cmdbatal_Click()

CboKode.SetFocus

CboKode = “Kode Laptop”

TxtMerk = “”

TxtHS = “”

TxtTotal = “”

TxtHargaPen = “”

TxtDis = “”

TxtTotal = “”

TxtJJual = “”

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub CmdHL_Click()

CboKode.SetFocus

CboKode = “Kode Laptop”

TxtMerk = “”

TxtHS = “”

TxtTotal = “”

TxtHargaPen = “”

TxtDis = “”

TxtTotal = “”

TxtJJual = “”

End Sub

 

Private Sub CmdKeluar_Click()

End

End Sub

 

Private Sub CmdProses_Click()

 

TxtHargaPen.Text = Val(TxtHS.Text) * Val(TxtJJual.Text)

Select Case TxtHargaPen.Text

Case Is > 140000000

TxtDis = Val(TxtHargaPen) * 0.15

Case Is > 135000000

TxtDis = Val(TxtHargaPen) * 0.1

Case Is > 130000000

TxtDis = Val(TxtHargaPen) * 0.05

Case Is > 125000000

TxtDis = Val(TxtHargaPen) * 0.02

End Select

TxtTotal = Val(TxtHargaPen) – Val(TxtDis)

 

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

End Sub

 

Private Sub Form_Load()

CboKode.AddItem “Apple MC965 MacBook Air”

CboKode.AddItem “Apple MC966 MacBook Air”

CboKode.AddItem “Apple MC968 MacBook Air”

CboKode.AddItem “Apple MC969 MacBook Air”

CboKode.AddItem “Apple MC700 MacBook Pro”

CboKode.AddItem “Apple MC721 MacBook Pro”

CboKode.AddItem “Apple MC723 MacBook Pro”

CboKode.AddItem “Apple MC724 MacBook Pro”

CboKode.AddItem “Apple MC311 MacBook Pro”

CboKode.AddItem “Apple MC313 MacBook Pro”

CboKode.AddItem “Apple MC314 MacBook Pro”

CboKode.AddItem “Apple MC318 MacBook Pro”

CboKode.AddItem “Apple MC322 MacBook Pro”

CboKode.AddItem “Apple MC965 MacBook Air”

CboKode.AddItem “Apple MC966 MacBook Air”

End Sub

 

TUGAS 4

entrikomputer

Private Sub CboKode_Click()

Dim JK, HS, HB As Integer

Select Case CboKode.Text

Case “P205”

JK = “Pentium II 500 Mega Hz”

HS = “1500000”

Case “P308”

JK = “Pentium III 800 Mega Hz”

HS = “2100000”

Case “P310”

JK = “Pentium III 1.0 Giga Hz”

HS = “3500000”

Case “P415”

JK = “Pentium IV 1.5 Giga Hz”

HS = “4000000”

Case “P417”

JK = “Pentium IV 1.7 Giga Hz”

HS = “4200000”

Case “P419”

JK = “Pentium IV 1.9 Giga Hz”

HS = “5500000”

End Select

TxtJCom = JK

TxtHS = HS

TxtJJual.SetFocus

End Sub

 

 

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub cmdbatal_Click()

CboKode.SetFocus

CboKode = “Kode”

TxtJCom = “”

TxtHS = “”

TxtJJual = “”

TxtHargaPen = “”

TxtDis = “”

TxtTotal = “”

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub CmdKeluar_Click()

End

End Sub

 

Private Sub CmdLagi_Click()

CboKode.SetFocus

CboKode = “Kode”

TxtJCom = “”

TxtHS = “”

TxtJJual = “”

TxtHargaPen = “”

TxtDis = “”

TxtTotal = “”

 

End Sub

 

Private Sub CmdProses_Click()

TxtHargaPen.Text = Val(TxtHS) * Val(TxtJJual)

Select Case TxtHargaPen.Text

Case Is > 30000000

TxtDis = Val(TxtHargaPen) * 0.15

Case Is > 25000000

TxtDis = Val(TxtHargaPen) * 0.1

Case Is > 20000000

TxtDis = Val(TxtHargaPen) * 0.05

Case Is > 15000000

TxtDis = Val(TxtHargaPen) * 0.02

End Select

TxtTotal = Val(TxtHargaPen) – Val(TxtDis)

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

 

End Sub

 

Private Sub Form_Load()

CboKode.AddItem “P205”

CboKode.AddItem “P308”

CboKode.AddItem “P310”

CboKode.AddItem “P415”

CboKode.AddItem “P417”

CboKode.AddItem “P419”

 

End Sub

 

TUGAS 5

DATABUKU1.PNG

 

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub Cmdbatal_Click()

CboKode.SetFocus

CboKode.Text = “Kode”

TxtJudulBuku.Text = “”

TxtPeng.Text = “”

TxtTahunTer.Text = “”

TxtPenerbit.Text = “”

TxtHarga.Text = “”

End Sub

 

Private Sub CmdEnd_Click()

End

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub CmdLagi_Click()

CboKode.SetFocus

CboKode.Text = “Kode”

TxtJudulBuku.Text = “”

TxtPeng.Text = “”

TxtTahunTer.Text = “”

TxtPenerbit.Text = “”

TxtHarga.Text = “”

End Sub

 

Private Sub CmdProses_Click()

Dim JudulB, Peng, Pen, Hg As String

TxtTahunTer.Text = “20” & Right(CboKode, 2)

s = Mid(CboKode, 3, 3)

If s = “SIM” Then

JudulB = “Sistem Informasi Manajemen”

Peng = “Yati Nur Oktavia”

Hg = “75900”

 

ElseIf s = “EDP” Then

JudulB = “Elektronik Data Processing”

Peng = “Imam Tarmizi”

Hg = “62000”

 

ElseIf s = “MNJ” Then

JudulB = “Manajemen”

Peng = “Valentina Mariana Adiwianti”

Hg = “42000”

 

ElseIf s = “CDR” Then

JudulB = “Corel Draw”

Peng = “Riyan Suhandi”

Hg = “53000”

 

ElseIf s = “RPL” Then

JudulB = “Rekayasa Perangkat Lunak”

Peng = “Sinta Umpu Singa”

Hg = “83000”

End If

TxtJudulBuku = JudulB

TxtPeng = Peng

TxtHarga = Hg

s = Mid(CboKode, 1, 1)

If s = “A” Then

Pen = “Andi Offset Yogyakarta”

ElseIf s = “I” Then

Pen = “Indah Surabaya”

ElseIf s = “S” Then

Pen = “Salemba Empat”

ElseIf s = “E” Then

Pen = “Elek Media Komputindo”

ElseIf s = “M” Then

Pen = “Maxicom”

End If

TxtPenerbit.Text = Pen

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

 

End Sub

 

Private Sub Form_Load()

CboKode.AddItem “A-SIM-01”

CboKode.AddItem “I-EDP-02”

CboKode.AddItem “S-MNJ-03”

CboKode.AddItem “E-CDR-04”

CboKode.AddItem “M-RPL-05”

End Sub

 

TUGAS 6

datapenjualantiet

 

Private Sub CmdKeluar_Click()

End

End Sub

Private Sub CmdLagi_Click()

TxtKt.SetFocus

TxtKt.Text = “”

TxtHt.Text = “”

TxtJk.Text = “”

TxtJb.Text = “”

TxtJt.Text = “”

TxtTotalP.Text = “”

End Sub

Private Sub CmdProses_Click()

Dim Jk, Ht, Jb As String

I = Left(TxtKt, 3)

If I = “BIM” Then

Jk = “BIMA”

Ht = “50000”

Jb = “16.00”

 

ElseIf I = “EKO” Then

Jk = “EKONOMI”

Ht = “35000”

Jb = “19.00”

ElseIf I = “MUT” Then

Jk = “MUTIARA”

Ht = “23000”

Jb = “17.00”

ElseIf I = “SEN” Then

Jk = “SENJA”

Ht = “15000”

Jb = “20.00”

End If

TxtJk = Jk

TxtHt = Ht

TxtJb = Jb

TxtJt.SetFocus

End Sub

 

Private Sub Command1_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub Command2_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

 

End Sub

 

Private Sub Command3_Click()

TxtKt.SetFocus

TxtKt.Text = “”

TxtHt.Text = “”

TxtJk.Text = “”

TxtJb.Text = “”

TxtJt.Text = “”

TxtTotalP.Text = “”

End Sub

 

Private Sub Command4_Click()

Data1.Recordset.Delete

 

End Sub

 

Private Sub TxtJt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtTotalP = Val(TxtHt) * Val(TxtJt)

End If

End Sub

 

TUGAS 7

DATABUKU2

 

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

End Sub

 

Private Sub CmdBatal_Click()

TxtKodeBuku.SetFocus

TxtKodeBuku = “”

TxtJudulBuku = “”

TxtPeng = “”

TxtTahunTer = “”

TxtPenerbit = “”

TxtHarga = “”

End Sub

 

Private Sub CmdEnd_Click()

End

End Sub

 

Private Sub cmdhapus_Click()

Data1.Recordset.Delete

End Sub

 

Private Sub CmdLagi_Click()

TxtKodeBuku.SetFocus

TxtKodeBuku = “”

TxtJudulBuku = “”

TxtPeng = “”

TxtTahunTer = “”

TxtPenerbit = “”

TxtHarga = “”

End Sub

 

Private Sub CmdProses_Click()

Dim JudulB, Peng, Pen, Hg As String

TxtTahunTer.Text = “20” & Mid(TxtKodeBuku, 5, 2)

s = Left(TxtKodeBuku, 3)

If s = “SIM” Then

JudulB = “Sistem Informasi Manajemen”

Peng = “Fadiya Ulfa”

Hg = “75900”

 

ElseIf s = “EDP” Then

JudulB = “Elektronik Data Processing”

Peng = “Nurul Agustina”

Hg = “62000”

 

ElseIf s = “MNJ” Then

JudulB = “Manajemen”

Peng = “Rian Hidayat”

Hg = “42000”

 

ElseIf s = “CDR” Then

JudulB = “Corel Draw”

Peng = “Siti Nur Khotimah”

Hg = “53000”

 

ElseIf s = “RPL” Then

JudulB = “Rekayasa Perangkat Lunak”

Peng = “Winda Erlianti”

Hg = “83000”

End If

TxtJudulBuku = JudulB

TxtPeng = Peng

TxtHarga = Hg

 

s = Mid(TxtKodeBuku, 1, 1)

If s = “A” Then

Pen = “Andi Offset Yogyakarta”

ElseIf s = “I” Then

Pen = “Indah Surabaya”

ElseIf s = “S” Then

Pen = “Salemba Empat”

ElseIf s = “E” Then

Pen = “Elek Media Komputindo”

ElseIf s = “M” Then

Pen = “Maxicom”

End If

TxtPenerbit.Text = Pen

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

End Sub

 

TUGAS 8

PTPULANG

Private Sub cmdadd_Click()

Data2.Recordset.AddNew

Data2.Recordset.Update

Data2.Recordset.MoveLast

End Sub

 

Private Sub CmdBatal_Click()

TxtNamaKar.SetFocus

TxtNamaKar = “”

TxtNik = “”

TxtGol = “”

TxtKode = “”

TxtStatus = “”

TxtTahun = “”

TxtJabatan = “”

TxtProf = “”

TxtGapok = “”

TxtTunj = “”

TxtTotalG = “”

End Sub

 

Private Sub cmdhapus_Click()

Data2.Recordset.Delete

 

End Sub

 

Private Sub CmdKeluar_Click()

End

End Sub

Private Sub CmdLagi_Click()

TxtNamaKar.SetFocus

TxtNamaKar = “”

TxtNik = “”

TxtGol = “”

TxtKode = “”

TxtStatus = “”

TxtTahun = “”

TxtJabatan = “”

TxtProf = “”

TxtGapok = “”

TxtTunj = “”

TxtTotalG = “”

End Sub

Private Sub CmdProses_Click()

Dim S As String

TxtTahun.Text = Left(TxtNik, 4)

S = Mid(TxtNik, 5, 1)

If S = “A” Then

TxtGol = “A”

TxtJabatan = “Manager”

TxtGapok = “4000000”

TxtTunj = “1025000”

ElseIf S = “B” Then

TxtGol = “B”

TxtJabatan = “Ka. Seksi”

TxtGapok = “3500000”

TxtTunj = “975000”

ElseIf S = “C” Then

TxtGol = “C”

TxtJabatan = “Staff”

TxtGapok = “3000000”

TxtTunj = “925000”

End If

S = Right(TxtNik, 3)

If S = “KEU” Then

TxtProf = “Accounting”

ElseIf S = “ADM” Then

TxtProf = “Administrasi”

ElseIf S = “SDM” Then

TxtProf = “General Affair”

ElseIf S = “EDP” Then

TxtProf = “IT Unit”

ElseIf S = “SPM” Then

TxtProf = “Security”

End If

S = Mid(TxtNik, 7, 1)

If S = “S” Then

TxtKode.Text = “S”

TxtStatus.Text = “Single”

ElseIf S = “M” Then

TxtKode.Text = “M”

TxtStatus.Text = “Menikah”

ElseIf S = “J” Then

TxtKode.Text = “J”

TxtStatus.Text = “Janda”

ElseIf S = “D” Then

TxtKode.Text = “D”

TxtStatus.Text = “Duda”

End If

TxtTotalG = Val(TxtGapok) + Val(TxtTunj)

End Sub

 

Private Sub cmdsave_Click()

Data2.Recordset.AddNew

Data2.Recordset.Update

Data2.Recordset.MoveNext

 

End Sub

 

 

Private Sub TxtNamaKar_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtNik.SetFocus

End If

End Sub

 

TUGAS 9

DBBARU

Private Sub cmdadd_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveLast

Txtkode.SetFocus

End Sub

 

Private Sub cmdcancel_Click()

Data1.Recordset.Delete

Data1.Recordset.MovePrevious

End Sub

 

Private Sub cmdhitung_Click()

txtby = Val(txthb * txtjb)

If txtjb.Text > 5 Then

txtpot = Val(txtby) * 0.02

Else

txtpot = Val(txtby) * 0

End If

txttb = Val(txtby – txtpot)

 

End Sub

 

Private Sub cmdkeluar_Click()

Form2.Show

End Sub

 

Private Sub cmdproses_Click()

Dim KB, HB, NB As Variant

KB = Mid(Txtkode, 5, 2)

Select Case KB

Case “SP”

NB = “SPIDOL”

HB = 9500

Case “BT”

NB = “BUKU TULIS”

HB = 12500

Case “TP”

NB = “TIP EX”

HB = 3000

Case “PG”

NB = “PENGGARIS”

HB = 25000

Case “PT”

NB = “PAPAN TULIS”

HB = 50000

End Select

Txtnb = NB

txthb = HB

txtjb.SetFocus

End Sub

 

Private Sub cmdsave_Click()

Data1.Recordset.AddNew

Data1.Recordset.Update

Data1.Recordset.MoveNext

End Sub

 

Private Sub Command1_Click()

End

End Sub

 

Private Sub Command2_Click()

Unload Me

End Sub

 

Advertisements

Tugas Bahasa Pemrograman Lagi

Tugas 1. Golongan

tugas lagi 1.PNG

Private Sub cbogolongan_Click()

Dim gapok, pajak, tunjangan, total As Variant

Select Case cbogolongan.Text

Case “A”

gapok = 30000000

tunjangan = 3000000

Case “B”

gapok = 5000000

tunjangan = 5000000

Case “C”

gapok = 6000000

tunjangan = 6000000

Case “D”

gapok = 7000000

tunjangan = 7000000

Case Else

gapok = 0

tunjangan = 0

End Select

total = gapok + tunjangan

pajak = total * 0.1

txtgapok.Text = gapok

txttunjangan.Text = tunjangan

txtpajak.Text = pajak

txttotal.Text = total – pajak

 

End Sub

 

Private Sub cmdbatal_Click()

kosong

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdlagi_Click()

kosong

 

End Sub

 

Private Sub Form_Load()

cbogolongan.AddItem “A”

cbogolongan.AddItem “B”

cbogolongan.AddItem “C”

cbogolongan.AddItem “D”

 

End Sub

 

Public Sub kosong()

txtnpm.SetFocus

txtnpm.Text = “”

txtnama.Text = “”

cbogolongan.Text = “”

txtgapok.Text = “”

txttunjangan.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

 

End Sub

 

Private Sub Txtnpm_keypress(keyascii As Integer)

 

If keyascii = 13 Then

txtnama.SetFocus

End If

 

End Sub

 

TUGAS 2. NPM

tugas lagi 2.PNG

 

Private Sub cmdbatal_Click()

txtnama.SetFocus

txtnama.Text = “”

txtnpm.Text = “”

txtjurusan.Text = “”

txtprodi.Text = “”

txttahun.Text = “”

txtnomor.Text = “”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdlagi_Click()

txtnama.SetFocus

txtnama.Text = “”

txtnpm.Text = “”

txtjurusan.Text = “”

txtprodi.Text = “”

txttahun.Text = “”

txtnomor.Text = “”

End Sub

 

Private Sub cmdproses_Click()

Dim S As String

txttahun.Text = “20” & Left(txtnpm.Text, 2)

S = Mid(txtnpm.Text, 3, 1)

If S = “1” Then

txtjurusan.Text = “Sistem Informasi”

ElseIf S = “2” Then

txtjurusan.Text = “Manajemen Informatika”

ElseIf S = “3” Then

txtjurusan.Text = “Tehnik Informatika”

ElseIf S = “4” Then

txtprodi.Text = “Manajemen & Komp. Akuntansi”

End If

S = Mid(txtnpm.Text, 4, 2)

If S = “01” Then

txtprodi.Text = “Strata Satu”

ElseIf S = “02” Then

txtprodi.Text = “Diploma Tiga”

ElseIf S = “03” Then

txtprodi.Text = “Diploma Empat”

ElseIf S = “04” Then

txtprodi.Text = “Diploma Dua”

End If

txtnomor.Text = Right(txtnpm.Text, 3)

 

End Sub

 

Private Sub Form_Activate()

txtnama.SetFocus

txtnama.Text = “”

txtnpm.Text = “”

txtjurusan.Text = “”

txtprodi.Text = “”

txttahun.Text = “”

txtnomor.Text = “”

 

End Sub

 

 

Private Sub txtnama_Keypress(Keyascii As Integer)

If Keyascii = 13 Then

txtnpm.SetFocus

End If

 

End Sub

 

TUGAS 3. Penjualan Laptop Apple

tugas lagi 3.1.PNG

Private Sub cbokode_Click()

Dim Merk, Satuan As Variant

Select Case cbokode.Text

Case “Apple MC965 MacBook Air”

Merk = “Apple MacBook Air MC965”

Satuan = 12800000

Case “Apple MC966 MacBook Air”

Merk = “Apple MacBook Air MC966”

Satuan = 15800000

Case “Apple MC968 MacBook Air”

Merk = “Apple MacBook Air MC965”

Satuan = 9900000

Case “Apple MC969 MacBook Air”

Merk = “Apple MacBook Air MC969”

Satuan = 11900000

Case “Apple MC700 MacBook Pro”

Merk = “Apple MacBook Pro MC700”

Satuan = 10800000

Case “Apple MC721 MacBook Pro”

Merk = “Apple MacBook Pro MC721”

Satuan = 15900000

Case “Apple MC723 MacBook Pro”

Merk = “Apple MacBook Pro MC723”

Satuan = 19300000

Case “Apple MC724 MacBook Pro”

Merk = “Apple MacBook Pro MC724”

Satuan = 13700000

Case “Apple MC311 MacBook Pro”

Merk = “Apple MacBook Pro MC311”

Satuan = 24200000

Case “Apple MC313 MacBook Pro”

Merk = “Apple MacBook Pro MC313”

Satuan = 11900000

Case “Apple MC314 MacBook Pro”

Merk = “Apple MacBook Pro MC314”

Satuan = 14700000

Case “Apple MC318 MacBook Pro”

Merk = “Apple MacBook Pro MC318”

Satuan = 17600000

Case “Apple MC322 MacBook Pro”

Merk = “Apple MacBook Pro MC322”

Satuan = 21300000

Case “Apple MC965 MacBook Pro”

Merk = “Apple MacBook Pro MC965”

Satuan = 12800000

Case “Apple MC966 MacBook Pro”

Merk = “Apple MacBook Pro MC966”

Satuan = 15800000

End Select

txtmerk.Text = Merk

txtharga.Text = Satuan

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdlagi_Click()

cbokode.SetFocus

cbokode = “Kode Laptop”

txtmerk = “”

txtharga = “”

txttotal = “”

txthargajual = “”

txtdis = “”

txttotal = “”

txtjumlahjual = “”

 

End Sub

 

Private Sub cmdproses_Click()

txthargajual.Text = Val(txtharga.Text) * Val(txtjumlahjual.Text)

Select Case txthargajual.Text

Case Is > 140000000

txtdis = Val(txthargajual) * 0.15

Case Is > 135000000

txtdis = Val(txthargajual) * 0.1

Case Is > 130000000

txtdis = Val(txthargajual) * 0.05

Case Is > 125000000

txtdis = Val(txthargajual) * 0.02

End Select

txttotal = Val(txthargajual) – Val(txtdis)

 

End Sub

 

Private Sub Form_Load()

cbokode.AddItem “Apple MC965 MacBook Air”

cbokode.AddItem “Apple MC966 MacBook Air”

cbokode.AddItem “Apple MC968 MacBook Air”

cbokode.AddItem “Apple MC969 MacBook Air”

cbokode.AddItem “Apple MC700 MacBook Pro”

cbokode.AddItem “Apple MC721 MacBook Pro”

cbokode.AddItem “Apple MC723 MacBook Pro”

cbokode.AddItem “Apple MC724 MacBook Pro”

cbokode.AddItem “Apple MC311 MacBook Pro”

cbokode.AddItem “Apple MC313 MacBook Pro”

cbokode.AddItem “Apple MC314 MacBook Pro”

cbokode.AddItem “Apple MC318 MacBook Pro”

cbokode.AddItem “Apple MC322 MacBook Pro”

cbokode.AddItem “Apple MC965 MacBook Air”

cbokode.AddItem “Apple MC966 MacBook Air”

 

End Sub

 

TUGAS 4. Penjualan Komputer

tugaslagi4.PNG

Private Sub cbokode_Click()

Dim JK, HS, HB As Integer

Select Case cbokode.Text

Case “P205”

JK = “Pentium II 500 Mega Hz”

HS = “1500000”

Case “P308”

JK = “Pentium III 800 Mega Hz”

HS = “2100000”

Case “P310”

JK = “Pentium III 1.0 Giga Hz”

HS = “3500000”

Case “P415”

JK = “Pentium IV 1.5 Giga Hz”

HS = “4000000”

Case “P417”

JK = “Pentium IV 1.7 Giga Hz”

HS = “4200000”

Case “P419”

JK = “Pentium IV 1.9 Giga Hz”

HS = “5500000”

End Select

txtjenis = JK

txtharga = HS

txtjumlah.SetFocus

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdlagi_Click()

cbokode.SetFocus

cbokode = “Pilih Kode”

txtjenis = “”

txtharga = “”

txtjumlah = “”

txthargajual = “”

txtdis = “”

txthargabayar = “”

 

End Sub

 

Private Sub cmdproses_Click()

txthargajual.Text = Val(txtharga) * Val(txtjumlah)

Select Case txthargajual.Text

Case Is > 30000000

txtdis = Val(txthargajual) * 0.15

Case Is > 25000000

txtdis = Val(txthargajual) * 0.1

Case Is > 20000000

txtdis = Val(txthargajual) * 0.05

Case Is > 15000000

txtdis = Val(txthargajual) * 0.02

End Select

txthargabayar = Val(txthargajual) – Val(txtdis)

 

End Sub

 

 

Private Sub Form_Load()

cbokode.AddItem “P205”

cbokode.AddItem “P308”

cbokode.AddItem “P310”

cbokode.AddItem “P415”

cbokode.AddItem “P417”

cbokode.AddItem “P419”

 

End Sub

 

TUGAS 5. DATA BUKU 1

tugaslagi5.PNG

Private Sub cmdbatal_Click(Index As Integer)

cbokode.SetFocus

cbokode.Text = “Kode”

txtjudul.Text = “”

txtpengarang.Text = “”

txttahun.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdlagi_Click()

cbokode.SetFocus

cbokode.Text = “Kode”

txtjudul.Text = “”

txtpengarang.Text = “”

txttahun.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

 

End Sub

 

Private Sub cmdproses_Click(Index As Integer)

 

Dim JudulBuku, Pengarang, Penerbit, Harga As String

 

txttahun.Text = “20” & Right(cbokode, 2)

s = Mid(cbokode, 3, 3)

If s = “SIM” Then

JudulBuku = “Sistem Informasi Manajemen”

Pengarang = “Yati Nur Oktavia”

Harga = “75900”

 

ElseIf s = “EDP” Then

JudulBuku = “Elektronik Data Processing”

Pengarang = “Imam Tarmizi”

Harga = “62000”

 

ElseIf s = “MNJ” Then

JudulBuku = “Manajemen”

Pengarang = “Valentina Mariana Adiwianti”

Harga = “42000”

 

ElseIf s = “CDR” Then

JudulBuku = “Corel Draw”

Pengarang = “Riyan Suhandi”

Harga = “53000”

 

ElseIf s = “RPL” Then

JudulBuku = “Rekayasa Perangkat Lunak”

Pengarang = “Sinta Umpu Singa”

Harga = “83000”

End If

txtjudul = JudulBuku

txtpengarang = Pengarang

txtharga = Harga

s = Mid(cbokode, 1, 1)

If s = “A” Then

Penerbit = “Andi Offset Yogyakarta”

ElseIf s = “I” Then

Penerbit = “Indah Surabaya”

ElseIf s = “S” Then

Penerbit = “Salemba Empat”

ElseIf s = “E” Then

Penerbit = “Elek Media Komputindo”

ElseIf s = “M” Then

Penerbit = “Maxicom”

End If

txtpenerbit.Text = Penerbit

 

End Sub

 

Private Sub Form_Load()

cbokode.AddItem “A-SIM-01”

cbokode.AddItem “I-EDP-02”

cbokode.AddItem “S-MNJ-03”

cbokode.AddItem “E-CDR-04”

cbokode.AddItem “M-RPL-05”

 

End Sub

 

TUGAS 6. Penjualan Tiket Kereta Api

tugaslagi6.PNG

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdlagi_Click()

txtkode.SetFocus

txtkode.Text = “”

txtharga.Text = “”

txtjenis.Text = “”

txtjam.Text = “”

txtjumlah.Text = “”

txttotal.Text = “”

 

End Sub

 

Private Sub cmdproses_Click()

Dim Jk, Ht, Jb As String

I = Left(txtkode, 3)

If I = “BIM” Then

Jk = “BIMA”

Ht = “50000”

Jb = “16.00”

 

ElseIf I = “EKO” Then

Jk = “EKONOMI”

Ht = “35000”

Jb = “19.00”

ElseIf I = “MUT” Then

Jk = “MUTIARA”

Ht = “23000”

Jb = “17.00”

ElseIf I = “SEN” Then

Jk = “SENJA”

Ht = “15000”

Jb = “20.00”

End If

txtjenis = Jk

txtharga = Ht

txtjam = Jb

txtjumlah.SetFocus

 

End Sub

Private Sub txtjumlah_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttotal = Val(txtharga) * Val(txtjumlah)

 

End If

 

End Sub

 

TUGAS 7. Data Buku Stmik 2

tugaslagi7.PNG

Private Sub cmdbatal_Click()

txtkodebuku.SetFocus

txtkodebuku = “”

txtjudul = “”

txtpengarang = “”

txttahun = “”

txtpenerbit = “”

txtharga = “”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdlagi_Click()

txtkodebuku.SetFocus

txtkodebuku = “”

txtjudul = “”

txtpengarang = “”

txttahun = “”

txtpenerbit = “”

txtharga = “”

 

End Sub

 

Private Sub cmdproses_Click()

Dim JudulB, Pengarang, Penerbit, Harga As String

txttahun.Text = “20” & Mid(txtkodebuku, 5, 2)

s = Left(txtkodebuku, 3)

If s = “SIM” Then

JudulB = “Sistem Informasi Manajemen”

Pengarang = “Fadiya Ulfa”

Harga = “75900”

 

ElseIf s = “EDP” Then

JudulB = “Elektronik Data Processing”

Pengarang = “Nurul Agustina”

Harga = “62000”

 

ElseIf s = “MNJ” Then

JudulB = “Manajemen”

Pengarang = “Rian Hidayat”

Harga = “42000”

 

ElseIf s = “CDR” Then

JudulB = “Corel Draw”

Pengarang = “Siti Nur Khotimah”

Harga = “53000”

 

ElseIf s = “RPL” Then

JudulB = “Rekayasa Perangkat Lunak”

Pengarang = “Winda Erlianti”

Harga = “83000”

End If

txtjudul = JudulB

txtpengarang = Pengarang

txtharga = Harga

s = Mid(txtkodebuku, 1, 1)

If s = “A” Then

Penerbit = “Andi Offset Yogyakarta”

ElseIf s = “I” Then

Penerbit = “Indah Surabaya”

ElseIf s = “S” Then

Penerbit = “Salemba Empat”

ElseIf s = “E” Then

Penerbit = “Elek Media Komputindo”

ElseIf s = “M” Then

Penerbit = “Maxicom”

End If

txtpenerbit.Text = Penerbit

End Sub

 

TUGAS 8. PT PULANG PETANG

tugaslagi8.PNG

 

Private Sub cmdbatal_Click()

txtnama.SetFocus

txtnama = “”

txtnik = “”

txtgol = “”

txtkode = “”

txtstatus = “”

txttahun = “”

txtjbt = “”

txtbag = “”

txtgapok = “”

txttjg = “”

txttotal = “”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub cmdlagi_Click()

txtnama.SetFocus

txtnama = “”

txtnik = “”

txtgol = “”

txtkode = “”

txtstatus = “”

txttahun = “”

txtjbt = “”

txtbag = “”

txtgapok = “”

txttjg = “”

txttotal = “”

 

End Sub

 

Private Sub cmdproses_Click()

Dim S As String

txttahun.Text = Left(txtnik, 4)

S = Mid(txtnik, 5, 1)

 

If S = “A” Then

txtgol = “A”

txtjbt = “Manager”

txtgapok = “4000000”

txttjg = “1025000”

 

ElseIf S = “B” Then

txtgol = “B”

txtjbt = “Ka. Seksi”

txtgapok = “3500000”

txttjg = “975000”

 

ElseIf S = “C” Then

txtgol = “C”

txtjbt = “Staff”

txtgapok = “3000000”

txttjg = “925000”

 

End If

 

S = Right(txtnik, 3)

If S = “KEU” Then

txtbag = “Accounting”

 

ElseIf S = “ADM” Then

txtbag = “Administrasi”

 

ElseIf S = “SDM” Then

TxtProf = “General Affair”

 

ElseIf S = “EDP” Then

txtbag = “IT Unit”

 

ElseIf S = “SPM” Then

txtbag = “Security”

 

End If

 

S = Mid(txtnik, 7, 1)

If S = “S” Then

txtkode.Text = “S”

txtstatus.Text = “Single”

 

ElseIf S = “M” Then

txtkode.Text = “M”

txtstatus.Text = “Menikah”

 

ElseIf S = “J” Then

txtkode.Text = “J”

txtstatus.Text = “Janda”

 

ElseIf S = “D” Then

txtkode.Text = “D”

txtstatus.Text = “Duda”

 

End If

txttotal = Val(txtgapok) + Val(txttjg)

 

End Sub

 

 

 

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

Program 3. Mencari Huruf Mutu Mahasiswa dengan Proses button

tugasbaru3.1

tugasbaru3.22

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

txtna.SetFocus

End If

 

End Sub

 

Private Sub txtuts_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtuas.SetFocus

End If

 

End Sub

Program 2. Variasi warna dan jenis tampilan menggunakan Visual Basic

tugasbaru2.1

tugasbaru2.2

Private Sub chkmiring_Click()

Label2.FontItalic = chkmiring.Value

End Sub

 

Private Sub chktebal_Click()

Label2.FontBold = chktebal.Value

 

End Sub

 

Private Sub cmdok_Click()

Label2.Caption = txt1.Text

 

End Sub

 

Private Sub cmdselesai_Click()

End

 

End Sub

 

Private Sub optbiru_Click()

Label2.ForeColor = vbBlue

 

End Sub

 

Private Sub optmerah_Click()

Label2.ForeColor = vbRed

 

End Sub

Program 1. Merubah bentuk dan warna judul dengan *cheklist dan *option button di Visual Basic

tugasbaru1.1

tugasbaru1.2

Private Sub Chkbold_Click()

‘Membuat teks tebal’

If Chkbold.Value = 1 Then

Lblteks.FontBold = True

Else

Lblteks.FontBold = False

End If

End Sub

 

 

 

Private Sub Chkitalic_Click()

‘Membuat teks miring’

If Chkitalic.Value = 1 Then

Lblteks.FontItalic = True

Else

Lblteks.FontItalic = False

End If

End Sub

 

Private Sub Chkstrikeout_Click()

‘Membuat teks garis tengah’

If Chkstrikeout.Value = 1 Then

Lblteks.FontStrikethru = True

Else

Lblteks.FontStrikethru = False

End If

End Sub

 

Private Sub Chkunderline_Click()

‘Membuat teks bergaris bawah’

If Chkunderline.Value = 1 Then

Lblteks.FontUnderline = True

Else

Lblteks.FontUnderline = False

End If

End Sub

 

Private Sub Cmdexit_Click()

End

 

End Sub

 

Private Sub Optblue_Click()

‘Membuat teks berwarna biru’

Lblteks.ForeColor = vbBlue

 

End Sub

 

Private Sub Optgreen_Click()

‘Membuat teks berwarna hijau’

Lblteks.ForeColor = vbGreen

 

End Sub

 

Private Sub Optred_Click()

‘Membuat teks berwarna merah’

Lblteks.ForeColor = vbRed

 

End Sub

 

Private Sub Optyellow_Click()

‘Membuat teks berwarna kuning’

Lblteks.ForeColor = vbYellow

 

End Sub

Tugas Bahasa Pemrograman 1

Program 1

Tugas 1 . PERKALIAN DUA BILANGAN dengan (hitung)

job 1.1.PNG

job 1.2.PNG

Private Sub Cmdhitung_Click()

herminhasil = Val(hermin1) * Val(hermin2)

 

End Sub

 

Private Sub hermin1_keypress(keyascii As Integer)

If keyascii = 13 Then

hermin2.SetFocus

End If

 

End Sub

 

Private Sub cmdbersih_Click()

hermin1.SetFocus

hermin1 = ” ”

hermin2 = ” ”

herminhasil = ” ”

 

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

 

End Sub

 

Private Sub Text1_Change()

 

End Sub

 

Tugas 2. PERHITUNGAN DUA BILANGAN dengan (enter)

job 2.1.PNG

 

job 2.2.PNG

Private Sub cmdherminbersih_Click()

hermin1.SetFocus

hermin1 = ” ”

hermin2 = ” ”

hermin3 = ” ”

 

End Sub

 

Private Sub cmdherminhitung_Click()

herminhasil = Val(hermin1) * Val(hermin2)

 

End Sub

 

Private Sub cmdherminkeluar_Click()

End

 

End Sub

 

Private Sub hermin1_keypress(keyascii As Integer)

If keyascii = 13 Then

hermin2.SetFocus

End If

 

 

End Sub

 

 

 

Private Sub herminhasil_keypress(keyascii As Integer)

If keyascii = 13 Then

herminhasil = Val(hermin1) * Val(hermin2)

End If

 

 

End Sub

 

 

 

Program 2

Tugas 3 . KALKULATOR MINI dengan (proses)

job 3.1.PNG

job 3.2.PNG

Private Sub cmdproses_Click()

pen3 = Val(pen1) + Val(pen2)

per3 = Val(per1) * Val(per2)

peng3 = Val(peng1) – Val(peng2)

pem3 = Val(pem1) / Val(pem2)

 

End Sub

 

Private Sub cmdlagi_Click()

pen1.SetFocus

 

pen1 = ” ”

pen2 = ” ”

pen3 = ” ”

per1 = ” ”

per2 = ” ”

per3 = ” ”

peng1 = ” ”

peng2 = ” ”

peng3 = ” ”

pem1 = ” ”

pem2 = ” ”

pem3 = ” ”

End Sub

 

Private Sub cmdbatal_Click()

pen1.SetFocus

 

pen1 = ” ”

pen2 = ” ”

pen3 = ” ”

per1 = ” ”

per2 = ” ”

per3 = ” ”

peng1 = ” ”

peng2 = ” ”

peng3 = ” ”

pem1 = ” ”

pem2 = ” ”

pem3 = ” ”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub pen1_keypress(keyascii As Integer)

If keyascii = 13 Then

pen2.SetFocus

End If

 

 

End Sub

 

 

 

Private Sub pem1_keypress(keyascii As Integer)

If keyascii = 13 Then

pem2.SetFocus

End If

 

End Sub

 

Private Sub pem2_keypress(keyascii As Integer)

If keyascii = 13 Then

pem3.SetFocus

End If

 

End Sub

 

 

 

Private Sub pen2_keypress(keyascii As Integer)

If keyascii = 13 Then

per1.SetFocus

End If

 

End Sub

 

 

 

Private Sub per1_keypress(keyascii As Integer)

If keyascii = 13 Then

per2.SetFocus

End If

 

End Sub

 

Private Sub per2_keypress(keyascii As Integer)

If keyascii = 13 Then

peng1.SetFocus

End If

 

End Sub

 

 

 

Private Sub peng1_keypress(keyascii As Integer)

If keyascii = 13 Then

peng2.SetFocus

End If

 

End Sub

 

Private Sub peng2_keypress(keyascii As Integer)

If keyascii = 13 Then

pem1.SetFocus

End If

 

End Sub

 

Private Sub Text3_Change()

 

End Sub

 

 

Tugas 4 . KALKULATOR MINI dengan (enter)

job 4.1.PNG

 

job 4.2.PNG

Private Sub Command1_Click()

Pen3 = Val(pen1) + Val(pen2)

Per3 = Val(per1) * Val(per2)

Peng3 = Val(peng1) – Val(peng2)

Pem3 = Val(pem1) / Val(pem2)

 

End Sub

 

Private Sub cmdlagi_Click()

pen1.SetFocus

pen1 = ” ”

pen2 = ” ”

pen3 = ” ”

per1 = ” ”

per2 = ” ”

per3 = ” ”

peng1 = ” ”

peng2 = ” ”

peng3= ” ”

pem1 = ” ”

pem2 = ” ”

pem3 = ” ”

End Sub

 

Private Sub cmdbatal_Click()

pen1.SetFocus

pen1 = ” ”

pen2 = ” ”

pen3 = ” ”

per1 = ” ”

per2 = ” ”

per3 = ” ”

peng1 = ” ”

peng2 = ” ”

peng3 = ” ”

pem1 = ” ”

pem2 = ” ”

pem3 = ” ”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub pen1_keypress(keyascii As Integer)

If keyascii = 13 Then

pen2.SetFocus

End If

 

 

End Sub

 

Private Sub pem1_keypress(keyascii As Integer)

If keyascii = 13 Then

Pem2.SetFocus

 

End If

 

End Sub

 

Private Sub pem2_keypress(keyascii As Integer)

If keyascii = 13 Then

Pem3 = Val(Text10) / Val(Text11)

End If

 

End Sub

 

Private Sub pen2_keypress(keyascii As Integer)

If keyascii = 13 Then

Per1.SetFocus

Pen3 = Val(pen1) + Val(pen2)

End If

 

End Sub

 

 

 

Private Sub per1_keypress(keyascii As Integer)

If keyascii = 13 Then

Per2.SetFocus

 

End If

 

End Sub

 

Private Sub per2_keypress(keyascii As Integer)

If keyascii = 13 Then

Peng1.SetFocus

Per3 = Val(per1) * Val(per2)

End If

 

End Sub

 

Private Sub peng1_keypress(keyascii As Integer)

If keyascii = 13 Then

Peng2.SetFocus

 

End If

 

End Sub

 

Private Sub peng2_keypress(keyascii As Integer)

If keyascii = 13 Then

Pem1.SetFocus

Peng3 = Val(peng1) – Val(peng2)

End If

 

End Sub

 

 

Program 3

Tugas 5 . PERHITUNGAN HARGA SETELAH DISKON 10 % dengan (hitung)

job 5.1

job 5.2

Private Sub cmdherminhitung_Click()

herminds = Val(herminha) * 0.1

herminhk = Val(herminha) – Val(herminds)

 

 

End Sub

 

Private Sub cmdherminulangi_Click()

herminha.SetFocus

herminha = ” ”

herminha = ” ”

herminha = ” ”

 

End Sub

 

Private Sub cmdherminkeluar_Click()

End

 

End Sub

 

Private Sub herminha_keypress(keyascii As Integer)

If keyascii = 13 Then

cmdherminhitung.SetFocus

End If

 

End Sub

 

 

Tugas 6 . PERHITUNGAN HARGA DISKON dengan (enter)

job 6.1.PNG

job 6.2.PNG

Private Sub cmdhitung_Click()

herminds = Val(herminha) * 0.1

herminhk = Val(herminha) – Val(herminds)

 

End Sub

 

Private Sub cmdulangi_Click()

herminha.SetFocus

herminha = ” ”

herminds = ” ”

herminhk = ” ”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub herminha_Keypress(keyascii As Integer)

If keyascii = 13 Then

herminds = Val(herminha) * 0.1

herminhk = Val(herminha) – Val(herminds)

End If

 

 

End Sub

 

Program 4

Tugas 7 . APLIKASI PERHITUNGAN GAJI dengan (proses)

job 7.1.PNG

job 7.2.PNG

Private Sub cmdproses_Click()

hermingk = Val(hermingp) + Val(hermintj) – Val(herminpt)

herminpj = Val(hermingk) * 0.1

hermingd = Val(hermingk) – Val(herminpj)

 

End Sub

 

Private Sub cmdulang_Click()

hermingp.SetFocus

hermingp = ” ”

hermintj = ” ”

herminpt = ” ”

hermingk = ” ”

herminpj = ” ”

hermingd = ” ”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

Private Sub hermingp_Keypress(keyascii As Integer)

If keyascii = 13 Then

hermintj.SetFocus

End If

 

End Sub

 

Private Sub hermintj_Keypress(keyascii As Integer)

If keyascii = 13 Then

herminpt.SetFocus

End If

 

End Sub

 

Private Sub herminpt_Keypress(keyascii As Integer)

If keyascii = 13 Then

hermingk.SetFocus

End If

 

 

End Sub

 

Tugas 8 . APLIKASI PERHITUNGAN GAJI dengan (enter)

job 8.1.PNG

job 8.2.PNG

Private Sub cmdulang_Click()

hermingp.SetFocus

hermingp = ” ”

hermintj = ” ”

herminpt = ” ”

hermingk = ” ”

herminpj = ” ”

hermingd = ” ”

 

End Sub

 

Private Sub cmdkeluar_Click()

End

 

End Sub

 

 

Private Sub hermingp_Keypress(keyascii As Integer)

If keyascii = 13 Then

hermintj.SetFocus

End If

 

 

End Sub

 

Private Sub herminpt_Keypress(keyascii As Integer)

If keyascii = 13 Then

hermingk = Val(hermingp) + Val(hermintj) – Val(herminpt)

herminpj = Val(hermingk) * 0.1

hermingd = Val(hermingk) – Val(herminpj)

End If

 

 

End Sub

 

Private Sub hermintj_Keypress(keyascii As Integer)

If keyascii = 13 Then

herminpt.SetFocus

End If

 

 

End Sub

 

Private Sub cmdproses_Click()

hermingk = Val(hermingp) + Val(hermintj) – Val(herminpt)

herminpj = Val(hermingk) * 0.1

hermingd = Val(hermingk) – Val(herminpj)

 

End Sub

 

Private Sub proses_Click()

 

End Sub