TUGAS PEMROGRAMAN 1

 

TUGAS 1

1

11

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

2

22

 

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

3

33

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

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

5.PNG

55

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

6

66

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

7

77.PNG

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

8

88.PNG

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

 

 

 

 

Iklan