TUGAS PEMOGRAMAN1

TUGAS 1

11.PNG

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

22

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

33

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

44

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

55

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

55

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

77

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

88

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

99

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

 

1010

 

Advertisements

tugas bahasa pemograman 1

 

TUGAS 1

desi golongan

Private Sub CboGolongan_Click()

Dim Golongan, GajiPokok, Tunjangan, Pajak, Total As Variant

Golongan = CboGolongan

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

TxtGajiPokok = GajiPokok

TxtTunjangan = Tunjangan

Pajak = (GajiPokok + Tunjangan) * 0.1

TxtPajak = Pajak

Total = GajiPokok + Tunjangan – Pajak

TxtTotal = Total

End Sub

 

Private Sub CmdBatal_Click()

TxtNidn.SetFocus

TxtNidn.Text = “”

TxtNama.Text = “”

CboGolongan.Text = “Pilih Golongan”

TxtGajiPokok = “”

TxtTunjangan = “”

TxtPajak = “”

TxtTotal = “”

End Sub

 

Private Sub CmdKeluar_Click()

Unload Me

End Sub

 

Private Sub CmdLagi_Click()

TxtNidn.SetFocus

TxtNidn.Text = “”

TxtNama.Text = “”

CboGolongan.Text = “Pilih Golongan”

TxtGajiPokok = “”

TxtTunjangan = “”

TxtPajak = “”

TxtTotal = “”

End Sub

 

Private Sub Form_Load()

CboGolongan.AddItem “I”

CboGolongan.AddItem “II”

CboGolongan.AddItem “III”

CboGolongan.AddItem “IV”

End Sub

 

Private Sub TxtNama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

CboGolongan.SetFocus

End If

End Sub

 

Private Sub TxtNidn_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

TxtNama.SetFocus

End If

End Sub

 

 

TUGAS 2

desinpm

Private Sub cmdbatal_Click()

txtnm.SetFocus

txtnm.Text = “”

txtnpm.Text = “”

txtjuru.Text = “”

txtps.Text = “”

txtmasuk.Text = “”

txtno.Text = “”

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

If KeyAscii = 13 Then

txtnpm.SetFocus

End If

End Sub

 

 

TUGAS 3

Capture1.2 PENJUALAN LAPTOP

 

Private Sub CboKode_Click()

Dim Merk, Harga, Kode As Variant

Kode = Mid(CboKode.Text, 7, 5)

Select Case Kode

Case “MC965”

Merk = “Apple MC965 MacBook Air”

Harga = 12800000

Case “MC966”

Merk = “Apple MC966 MacBook Air

Harga = 15800000

Case “MC968”

Merk = “Apple MC968 MacBook Air”

Harga = 9900000

Case “MC969”

Merk = “Apple MC969 MacBook Air”

Harga = 11900000

Case “MC700”

Merk = “Apple MC700 MacBook Pro”

Harga = 10800000

Case “MC721”

Merk = “Apple MC721 MacBook Pro”

Harga = 15900000

Case “MC723”

Merk = “Apple MC723 MacBook Pro”

Harga = 19300000

Case “MC724”

Merk = “Apple MC724 MacBook Pro”

Harga = 13700000

Case “MC311”

Merk = “Apple MC311 MacBook Pro”

Harga = 24200000

Case “MC313”

Merk = “Apple MC313 MacBook Pro”

Harga = 11900000

Case “MC314”

Merk = “Apple MC314 MacBook Pro”

Harga = 14700000

Case “MC318”

Merk = “Apple MC318 MacBook Pro”

Harga = 17600000

Case “MC322”

Merk = “Apple MC322 MacBook Pro”

Harga = 21300000

End Select

TxtMerk = Merk

TxtHarga = Harga

End Sub

 

Private Sub CmdKeluar_Click()

Unload Me

End Sub

 

Private Sub CmdLagi_Click()

CboKode.SetFocus

CboKode.Text = “Pilih Kode Laptop”

TxtMerk.Text = “”

TxtHarga.Text = “”

TxtJual.Text = “”

TxtHargaJual.Text = “”

TxtDiskon.Text = “”

TxtTotal.Text = “”

End Sub

 

Private Sub CmdProses_Click()

Dim HS, Jual, Jumlah, Diskon, Total As Variant

HS = Val(TxtHarga)

Jual = Val(TxtJual)

Jumlah = HS * Jual

TxtHargaJual = Jumlah

Select Case Jumlah

Case Is > 140000000

Diskon = Jumlah * 0.15

Case Is > 135000000

Diskon = Jumlah * 0.1

Case Is > 130000000

Diskon = Jumlah * 0.05

Case Is > 125000000

Diskon = Jumlah * 0.02

Case Is <= 125000000

Diskon = Jumlah * 0

End Select

TxtDiskon = Diskon

 

Total = Jumlah – Diskon

TxtTotal = Total

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”

End Sub

 

 

TUGAS 4

Capture1.4penjualan kom

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 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 Form_Load()

CboKode.AddItem “P205”

CboKode.AddItem “P308”

CboKode.AddItem “P310”

CboKode.AddItem “P415”

CboKode.AddItem “P417”

CboKode.AddItem “P419”

End Sub

 

 

TUGAS 5

capture1.1

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 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 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

Capture1.3 KERETA API

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

If KeyAscii = 13 Then

TxtTotalP = Val(TxtHt) * Val(TxtJt)

End If

End Sub

 

 

TUGAS 7

capture1.1

Private Sub CmdBatal_Click()

TxtKodeBuku.SetFocus

TxtKodeBuku = “”

TxtJudulBuku = “”

TxtPeng = “”

TxtTahunTer = “”

TxtPenerbit = “”

TxtHarga = “”

End Sub

 

Private Sub CmdEnd_Click()

End

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

 

 

TUGAS 8

Capture1.6 PULNG PETANG

Private Sub CmdBatal_Click()

TxtNamaKar.SetFocus

TxtNamaKar = “”

TxtNik = “”

TxtGol = “”

TxtKode = “”

TxtStatus = “”

TxtTahun = “”

TxtJabatan = “”

TxtProf = “”

TxtGapok = “”

TxtTunj = “”

TxtTotalG = “”

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

If KeyAscii = 13 Then

TxtNik.SetFocus

End If

End Sub

 

 

 

 

tugas ke3 bahasa pemograman1

Capture 1

TUGAS 1

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 chkstikethru_Click()

‘membuat teks Bergaris tengah’

If chkstikethru.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

 

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 chkstikethru_Click()

‘membuat teks Bergaris tengah’

If chkstikethru.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

Capture 2

TUGAS 2

Private Sub ChhMiring_Click()

If ChhMiring.Value = 1 Then

Label2.FontItalic = True

Else

Label2.FontItalic = False

End If

End Sub

 

Private Sub ChkTebal_Click()

Label2.FontBold = ChkTebal.Value

End Sub

 

Private Sub CmdOK_Click()

Label2.Caption = Text1.Text

End Sub

 

Private Sub CmdSELESAI_Click()

End

End Sub

 

Private Sub OptBiru_Click()

Lebel2.ForeColor = vbBlue

End Sub

 

Private Sub OptMerah_Click()

Lebel2.ForeColor = vbRed

End Sub

 

Private Sub OptBlue_Click()

Label2.ForeColor = vbBlue

End Sub

 

Private Sub OptRed_Click()

Label2.ForeColor = vbRed

End Sub

Capture proses

TUGAS 3

Private Sub cbonpm_Click()

Dim nama, jurusan, HM As String

 

Select Case cbonpm.Text

Case “15100007”

nama = “DESI YULIANTI”

jurusan = “Sistem Informasi”

Case “15100018”

nama = “TRI SETIA NINGSIH”

jurusan = “Manajemen Informatika”

Case “15100040”

nama = “BAGAS ANGGARA”

jurusan = “Manajemen Informatika”

Case “15100005”

nama = “ANGGI MAHARANI”

jurusan = “Teknik Informatika”

End Select

Text1.Text = nama

Text2.Text = jurusan

Textquis.SetFocus

 

End Sub

 

Private Sub Cmdbatal_Click()

cbonpm.SetFocus

cbonpm.Text = “”

Text1.Text = “”

Text2.Text = “”

Textquis.Text = “”

Texttugas = “”

Textuts.Text = “”

Textuas.Text = “”

Textna.Text = “”

Texthm.Text = “”

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdproses_Click()

Dim NA As Integer

Dim HM As String

QUIS = Val(Textquis.Text)

TUGAS = Val(Texttugas.Text)

UTS = Val(Textuts.Text)

UAS = Val(Textuas.Text)

NA = Val(QUIS + TUGAS + UTS + UAS) / 4

Textna.Text = NA

Select Case Textna.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

Texthm.Text = HM

 

End Sub

 

Private Sub Form_Load()

cbonpm.AddItem “15100007”

cbonpm.AddItem “15100018”

cbonpm.AddItem “15100040”

cbonpm.AddItem “15100005”

End Sub

 

 

 

Private Sub Textquis_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Texttugas.SetFocus

End If

End Sub

 

 

Private Sub Texttugas_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Textuts.SetFocus

End If

End Sub

Private Sub Textuas_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim NA As Integer

Dim HM As String

QUIS = Val(Textquis.Text)

TUGAS = Val(Texttugas.Text)

UTS = Val(Textuts.Text)

UAS = Val(Textuas.Text)

NA = Val(QUIS + TUGAS + UTS + UAS) / 4

Textna.Text = NA

Select Case Textna.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

Texthm.Text = HM

End If

 

End Sub

 

Private Sub Textuts_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Textuas.SetFocus

End If

End Sub

Capture444

TUGAS 4

Private Sub Textuas_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Dim NA As Integer

Dim HM As String

QUIS = Val(Textquis.Text)

TUGAS = Val(Texttugas.Text)

UTS = Val(Textuts.Text)

UAS = Val(Textuas.Text)

NA = Val(QUIS + TUGAS + UTS + UAS) / 4

Textna.Text = NA

Select Case Textna.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

Texthm.Text = HM

End If

End Sub