tugas 4

r1-2r-3r4-5r-6r-7r08r-9

Nama    :ryo andreal

Npm      :14100092

Kelas     :website 3

No 1 dan 2

 

Private Sub Cbonpm_Click()

Dim nama, jurusan As String

Select Case cbonpm.Text

Case “09100027”

nama = “AFNAN ZALFA SALSABILA A”

jurusan = “Sistem Informasi”

Case “09200048”

nama = “AMALIA AMANAH”

jurusan = “Manajemen Informatika”

Case “09300024”

nama = “SASKIA MECHA”

jurusan = “Tehnik Informatika”

End Select

txtnama.Text = nama

txtjurusan.Text = jurusan

txtquis.SetFocus

End Sub

 

Private Sub Form_Load()

cbonpm.AddItem “09100027”

cbonpm.AddItem “09200048”

cbonpm.AddItem “09300024”

End Sub

 

Private Sub Label1_Click()

 

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 txtuts_KeyPress(keyascii As Integer)

If keyascii = 13 Then

txtuas.SetFocus

End If

End Sub

 

 

Private Sub Cmdbatal_Click()

cbonpm.SetFocus

cbonpm.Text = “”

txtnama.Text = “”

txtjurusan.Text = “”

txtquis.Text = “”

txttugas.Text = “”

txtuts.Text = “”

txtuas.Text = “”

txtna.Text = “”

txthm.Text = “”

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

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

NO 3

Private Sub Cmdbatal_Click()

kosong

End Sub

Private Sub cmdlagi_Click()

kosong

End Sub

 

Private Sub Form_load()

cbogolongan.AddItem “I”

cbogolongan.AddItem “II”

cbogolongan.AddItem “III”

cbogolongan.AddItem “IV”

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

Private Sub cbogolongan_Click()

Dim gapok, pajak, tunjangan, total As Variant

Select Case cbogolongan.Text

Case “I”

gapok = 1500000

tunjangan = 150000

Case “II”

gapok = 2000000

tunjangan = 200000

Case “III”

gapok = 2500000

tunjangan = 250000

Case “IV”

gapok = 3000000

tunjangan = 300000

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

Public Sub kosong()

txtnidn.SetFocus

txtnidn.Text = “”

txtnama.Text = “”

cbogolongan.Text = “”

txtgapok.Text = “”

txttunjangan.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub txtnind_keypress(keyascii As Integer)

If keyascii = 13 Then

txtnama.SetFocus

End If

End Sub

NO 4.5

Private Sub Cmdbatal_Click()

kosong

End Sub

Private Sub cmdlagi_Click()

kosong

End Sub

 

Private Sub Form_load()

cbogolongan.AddItem “I”

cbogolongan.AddItem “II”

cbogolongan.AddItem “III”

cbogolongan.AddItem “IV”

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

Private Sub cbogolongan_Click()

Dim gapok, pajak, tunjangan, total As Variant

Select Case cbogolongan.Text

Case “I”

gapok = 1500000

tunjangan = 150000

Case “II”

gapok = 2000000

tunjangan = 200000

Case “III”

gapok = 2500000

tunjangan = 250000

Case “IV”

gapok = 3000000

tunjangan = 300000

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

Public Sub kosong()

txtnidn.SetFocus

txtnidn.Text = “”

txtnama.Text = “”

cbogolongan.Text = “”

txtgapok.Text = “”

txttunjangan.Text = “”

txtpajak.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub txtnind_keypress(keyascii As Integer)

If keyascii = 13 Then

txtnama.SetFocus

End If

End Sub

NO 6

 

Private Sub cmdlagi_Click()

txtkodebuku.SetFocus

txtkodebuku.Text = “”

txtjudulbuku.Text = “”

txtpengarang.Text = “”

txttahunterbit.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

End Sub

 

Private Sub cmdbatal_Click()

txtkodebuku.SetFocus

txtkodebuku.Text = “”

txtjudulbuku.Text = “”

txtpengarang.Text = “”

txttahunterbit.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

End Sub

Private Sub cmdkeluar_click()

End

End Sub

 

 

Private Sub Cmdproses_Click()

Dim S As String

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

S = Left(txtkodebuku.Text, 3)

If S = “SIM” Then

txtjudulbuku.Text = “Sistem Informasi”

txtpengarang.Text = “Fadiya ulfa”

ElseIf S = “EDP” Then

txtjudulbuku.Text = “elektronik data Procesing”

txtpengarang.Text = “Nurul Agustina”

ElseIf S = “MNJ” Then

txtjudulbuku.Text = “Manajemen”

txtpengarang.Text = “Riyan Hidayat”

ElseIf S = “CDR” Then

txtjudulbuku.Text = “Corel Draw”

txtpengarang.Text = “Siti Nurkhotimah”

ElseIf S = “RPL” Then

txtjudulbuku.Text = “Rekaya Perangkat Lunak ”

txtpengarang.Text = “Winda erlianti”

 

 

End If

S = Mid(txtkodebuku.Text, 8, 1)

If S = “A” Then

txtpenerbit.Text = “Andi offset yogyakarta”

txtharga.Text = “75900”

ElseIf S = “I” Then

txtpenerbit.Text = “Indah Surabaya”

txtharga.Text = “62000”

ElseIf S = “S” Then

txtpenerbit.Text = “Salemba Empat”

txtharga.Text = “42000”

ElseIf S = “E” Then

txtpenerbit.Text = “Elek Media Komputindo”

txtharga.Text = “53000”

ElseIf S = “M” Then

txtpenerbit.Text = “Maxicom”

txtharga.Text = “83000”

End If

 

End Sub

 

Private Sub Form_Load()

 

End Sub

 

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

 

End Sub

 

Private Sub Label1_Click()

 

End Sub

 

Private Sub Label3_Click()

 

End Sub

 

Private Sub Label4_Click()

 

End Sub

 

Private Sub Label6_Click()

 

End Sub

 

Private Sub txtharga_Change()

 

End Sub

 

Private Sub txtpenerbit_Change()

 

End Sub

 

Private Sub txtpengarang_Change()

 

End Sub

 

Private Sub txttahunterbit_Change()

 

End Sub

NO 7

Private Sub cmdlagi_Click()

txtkodebuku.SetFocus

txtkodebuku.Text = “”

txtjudulbuku.Text = “”

txtpengarang.Text = “”

txttahunterbit.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

End Sub

 

Private Sub cmdbatal_Click()

txtkodebuku.SetFocus

txtkodebuku.Text = “”

txtjudulbuku.Text = “”

txtpengarang.Text = “”

txttahunterbit.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

End Sub

Private Sub cmdkeluar_click()

End

End Sub

 

 

Private Sub Cmdproses_Click()

Dim S As String

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

S = Left(txtkodebuku.Text, 3)

If S = “SIM” Then

txtjudulbuku.Text = “Sistem Informasi”

txtpengarang.Text = “Fadiya ulfa”

ElseIf S = “EDP” Then

txtjudulbuku.Text = “elektronik data Procesing”

txtpengarang.Text = “Nurul Agustina”

ElseIf S = “MNJ” Then

txtjudulbuku.Text = “Manajemen”

txtpengarang.Text = “Riyan Hidayat”

ElseIf S = “CDR” Then

txtjudulbuku.Text = “Corel Draw”

txtpengarang.Text = “Siti Nurkhotimah”

ElseIf S = “RPL” Then

txtjudulbuku.Text = “Rekaya Perangkat Lunak ”

txtpengarang.Text = “Winda erlianti”

 

 

End If

S = Mid(txtkodebuku.Text, 8, 1)

If S = “A” Then

txtpenerbit.Text = “Andi offset yogyakarta”

txtharga.Text = “75900”

ElseIf S = “I” Then

txtpenerbit.Text = “Indah Surabaya”

txtharga.Text = “62000”

ElseIf S = “S” Then

txtpenerbit.Text = “Salemba Empat”

txtharga.Text = “42000”

ElseIf S = “E” Then

txtpenerbit.Text = “Elek Media Komputindo”

txtharga.Text = “53000”

ElseIf S = “M” Then

txtpenerbit.Text = “Maxicom”

txtharga.Text = “83000”

End If

 

End Sub

 

Private Sub Form_Load()

 

End Sub

 

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

 

End Sub

 

Private Sub Label1_Click()

 

End Sub

 

Private Sub Label3_Click()

 

End Sub

 

Private Sub Label4_Click()

 

End Sub

 

Private Sub Label6_Click()

 

End Sub

 

Private Sub txtharga_Change()

 

End Sub

 

Private Sub txtpenerbit_Change()

 

End Sub

 

Private Sub txtpengarang_Change()

 

End Sub

 

Private Sub txttahunterbit_Change()

 

End Sub

 

 

NO 8

Private Sub c_Click()

End

End Sub

 

Private Sub ds_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hb.SetFocus

End If

End Sub

 

Private Sub Form_Load()

kk.AddItem “P205”

kk.AddItem “P308”

kk.AddItem “P310”

kk.AddItem “P415”

kk.AddItem “P417”

kk.AddItem “P419”

End Sub

 

Private Sub hb_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

ps.SetFocus

End If

End Sub

 

Private Sub hp_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

ds.SetFocus

End If

End Sub

 

Private Sub hs_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

jj.SetFocus

End If

End Sub

 

Private Sub ht_Click()

kk.SetFocus

kk.Text = “”

jk.Text = “”

hs.Text = “”

jj.Text = “”

hp.Text = “”

ds.Text = “”

hb.Text = “”

End Sub

 

Private Sub jj_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hp.Text = Val(hs.Text) * (jj.Text)

End If

hp.Text = hp

Select Case hp.Text

Case Is > 30000000

ds.Text = Val(hp.Text) * 0.15

Case Is > 25000000

ds.Text = Val(hp.Text) * 0.1

Case Is > 20000000

ds.Text = Val(hp.Text) * 0.5

Case Is > 15000000

ds.Text = Val(hp.Text) * 0.2

End Select

hb.Text = Val(hp.Text) – Val(ds.Text)

 

End Sub

 

Private Sub jk_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hs.SetFocus

End If

End Sub

 

Private Sub kk_Click()

If kk.Text = “P205” Then

jk.Text = “Pentium II 500 Mega Hz”

hs.Text = “1500000”

ElseIf kk.Text = “P308” Then

jk.Text = “Pentium III 800 Mega Hz”

hs.Text = “2100000”

ElseIf kk.Text = “P310” Then

jk.Text = “Pentium III 1.0 Giga Hz”

hs.Text = “3500000”

ElseIf kk.Text = “P415” Then

jk.Text = “Pentium IV 1.5 Giga Hz”

hs.Text = “4000000”

ElseIf kk.Text = “P417” Then

jk.Text = “Pentium Iv 1.7 Giga Hz”

hs.Text = “4200000”

ElseIf kk.Text = “P419” Then

jk.Text = “Pentium IV 1.9 Giga Hz”

hs.Text = “5500000”

End If

End Sub

 

Private Sub kk_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

jk.SetFocus

End If

End Sub

 

Private Sub ps_Click()

hp.Text = Val(hs.Text) * (jj.Text)

hp.Text = hp

Select Case hp.Text

Case Is > 30000000

ds.Text = Val(hp.Text) * 0.15

Case Is > 25000000

ds.Text = Val(hp.Text) * 0.1

Case Is > 20000000

ds.Text = Val(hp.Text) * 0.5

Case Is > 15000000

ds.Text = Val(hp.Text) * 0.2

End Select

hb.Text = Val(hp.Text) – Val(ds.Text)

End Sub

NO 9

Private Sub ds_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

tb.SetFocus

End If

End Sub

 

Private Sub Form_Load()

kp.AddItem “Apple MC965 Macbook Air”

kp.AddItem “Apple MC966 Macbook Air”

kp.AddItem “Apple MC968 Macbook Air”

kp.AddItem “Apple MC969 Macbook Air”

kp.AddItem “Apple MC700 Macbook Pro”

kp.AddItem “Apple MC721 Macbook Pro”

kp.AddItem “Apple MC723 Macbook Pro”

kp.AddItem “Apple MC311 Macbook Pro”

kp.AddItem “Apple MC313 Macbook Pro”

kp.AddItem “Apple MC314 Macbook Pro”

kp.AddItem “Apple MC318 Macbook Pro”

kp.AddItem “Apple MC322 Macbook Pro”

kp.AddItem “Apple MC965 Macbook Air”

kp.AddItem “Apple MC966 Macbook Air”

 

End Sub

Private Sub hp_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

ds.SetFocus

End If

End Sub

 

Private Sub hs_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

jj.SetFocus

End If

End Sub

 

Private Sub ht_Click()

kp.SetFocus

kp.Text = “”

mt.Text = “”

hs.Text = “”

jj.Text = “”

hp.Text = “”

ds.Text = “”

tb.Text = “”

End Sub

 

Private Sub jj_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hp.SetFocus

hp.Text = Val(hs.Text) * Val(jj.Text)

End If

Select Case hp.Text

Case Is > 140000000

ds.Text = Val(hp.Text) * 0.15

Case Is > 135000000

ds.Text = Val(hp.Text) * 0.1

Case Is > 130000000

ds.Text = Val(hp.Text) * 0.5

Case Is > 125000000

ds.Text = Val(hp.Text) * 0.2

End Select

tb.Text = Val(hp.Text) – Val(ds.Text)

End Sub

 

Private Sub kl_Click()

End

End Sub

 

Private Sub kp_Click()

If kp.Text = “Apple MC965 Macbook Air” Then

mt.Text = “Apple Macbook Air MC965”

hs.Text = “12800000”

ElseIf kp.Text = “Apple MC966 Macbook Air” Then

mt.Text = “Apple Macbook Air MC965”

hs.Text = “15800000”

ElseIf kp.Text = “Apple MC968 Macbook Air” Then

mt.Text = “Apple Macbook Air MC968”

hs.Text = “9900000”

ElseIf kp.Text = “Apple MC969 Macbook Air” Then

mt.Text = “Apple Macbook Air MC969”

hs.Text = “11900000”

ElseIf kp.Text = “Apple MC700 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC700”

hs.Text = “10800000”

ElseIf kp.Text = “Apple MC721 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC721”

hs.Text = “15900000”

ElseIf kp.Text = “Apple MC723 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC723”

hs.Text = “19300000”

ElseIf kp.Text = “Apple MC311 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC311”

hs.Text = “24200000”

ElseIf kp.Text = “Apple MC313 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC313”

hs.Text = “11900000”

ElseIf kp.Text = “Apple MC314 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC314”

hs.Text = “14700000”

ElseIf kp.Text = “Apple MC318 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC318”

hs.Text = “17600000”

ElseIf kp.Text = “Apple MC322 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC322”

hs.Text = “21300000”

ElseIf kp.Text = “Apple MC965 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC965”

hs.Text = “12800000”

ElseIf kp.Text = “Apple MC966 Macbook Pro” Then

mt.Text = “Apple Macbook Pro MC966”

hs.Text = “15800000”

End If

End Sub

 

 

 

Private Sub kp_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

mt.SetFocus

End If

End Sub

Private Sub mt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

hs.SetFocus

End If

End Sub

 

Private Sub ps_Click()

hp.Text = Val(hs.Text) * Val(jj.Text)

Select Case hp.Text

Case Is > 140000000

ds.Text = Val(hp.Text) * 0.15

Case Is > 135000000

ds.Text = Val(hp.Text) * 0.1

Case Is > 130000000

ds.Text = Val(hp.Text) * 0.5

Case Is > 125000000

ds.Text = Val(hp.Text) * 0.2

End Select

tb.Text = Val(hp.Text) – Val(ds.Text)

End Sub

 

Tinggalkan komentar