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

 

 

 

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s