TUGAS BAHASA PEMROGRAMAN VISUAL BASIC 4

TUGAS 4.1

1

Private Sub cboKode_Click()

Dim mt, hs, TB As Integer

Select Case cboKode.Text

Case “Apple MC965 MacBook Air”

mt = “Apple MacBook Air MC965”

hs = “12800000”

Case “Apple MC966 MacBook Air”

mt = “Apple MacBook Air MC966”

hs = “15800000”

Case “Apple MC968 MacBook Air”

mt = “Apple MacBook Air MC968”

hs = “9900000”

Case “Apple MC969 MacBook Air”

mt = “Apple MacBook Air MC969”

hs = “11900000”

Case “Apple MC700 MacBook Pro”

mt = “Apple MacBook Pro MC700”

hs = “10800000”

Case “Apple MC721 MacBook Pro”

mt = “Apple MacBook Pro MC721”

hs = “15900000”

Case “Apple MC723 MacBook Pro”

mt = “Apple MacBook Pro MC723”

hs = “19300000”

Case “Apple MC724 MacBook Pro”

mt = “Apple MacBook Pro MC724”

hs = “13700000”

Case “Apple MC311 MacBook Pro”

mt = “Apple MacBook Pro MC311”

hs = “24200000”

Case “Apple MC313 MacBook Pro”

mt = “Apple MacBook Pro MC313”

hs = “11900000”

Case “Apple MC314 MacBook Pro”

mt = “Apple MacBook Pro MC314”

hs = “14700000”

Case “Apple MC318 MacBook Pro”

mt = “Apple MacBook Pro MC318”

hs = “17600000”

Case “Apple MC322 MacBook Pro”

mt = “Apple MacBook Pro MC322”

hs = “21300000”

Case “Apple MC965 MacBook Air”

mt = “Apple MacBook Air MC965”

hs = “12800000”

Case “Apple MC966 MacBook Air”

mt = “Apple MacBook Air MC966”

hs = “15800000”

End Select

txtmerk.Text = mt

txtharga.Text = hs

txtjumlah.SetFocus

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

cboKode.SetFocus

cboKode.Text = “”

txtmerk.Text = “”

txtharga.Text = “”

txtjumlah.Text = “”

txtharpen.Text = “”

txtdiskon.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub cmdproses_Click()

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

Select Case txtharpen.Text

Case Is > 140000000

txtdiskon.Text = Val(txtharpen) * 0.15

Case Is > 135000000

txtdiskon.Text = Val(txtharpen) * 0.1

Case Is > 130000000

txtdiskon.Text = Val(txtharpen) * 0.05

Case Is > 125000000

txtdiskon.Text = Val(txtharpen) * 0.02

End Select

txttotal.Text = Val(txtharpen) – Val(txtdiskon)

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

2

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.Text = jk

txtharga.Text = hs

txtjumlah.SetFocus

End Sub

 

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

cbokode.SetFocus

cbokode.Text = “”

txtjenis.Text = “”

txtharga.Text = “”

txtjumlah.Text = “”

txtharpen.Text = “”

txtdiskon.Text = “”

txtbayar.Text = “”

End Sub

 

 

Private Sub cmdproses_Click()

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

Select Case txtharpen.Text

Case Is > 30000000

txtdiskon.Text = Val(txtharpen) * 0.15

Case Is > 25000000

txtdiskon.Text = Val(txtharpen) * 0.1

Case Is > 20000000

txtdiskon.Text = Val(txtharpen) * 0.05

Case Is > 15000000

txtdiskon.Text = Val(txtharpen) * 0.02

End Select

txtbayar.Text = Val(txtharpen) – Val(txtdiskon)

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 4.3

3

Private Sub cmdbatal_Click()

cbokode.SetFocus

cbokode.Text = “”

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 = “”

txtjudul.Text = “”

txtpengarang.Text = “”

txttahun.Text = “”

txtpenerbit.Text = “”

txtharga.Text = “”

End Sub

 

Private Sub cmdproses_Click()

Dim jb, pg, pn, hg As String

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

s = Mid(cbokode, 3, 3)

If s = “SIM” Then

jb = “SistemInformasiManajeme”

pg = “YatiNurOktavia”

hg = “75900”

ElseIf s = “EDP” Then

jb = “ElektronikData Processing”

pg = “Imam Tarmizi”

hg = “62000”

ElseIf s = “MNJ” Then

jb = “Manajemen”

pg = “Valentina Mariana Adiwianti”

hg = “42000”

ElseIf s = “CDR” Then

jb = “Corel Draw”

pg = “RiyanSuhandi”

hg = “53000”

ElseIf s = “RPL” Then

jb = “RekayasaPerangkatLunak”

pg = “SintaUmpuSinga”

hg = “83000”

End If

txtjudul.Text = jb

txtpengarang.Text = pg

txtharga.Text = hg

s = Mid(cbokode, 1, 1)

If s = “A” Then

pn = “Andi Offset Yogyakarta”

ElseIf s = “I” Then

pn = “Indah Surabaya”

ElseIf s = “S” Then

pn = “SalembaEmpat”

ElseIf s = “E” Then

pn = “Elek Media Komputindo”

ElseIf s = “M” Then

pn = “Maxicom”

End If

txtpenerbit.Text = pn

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 4.4

4

Private Sub Cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

 

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

 

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

Txttm.Text = “20” & Left(Txtnpm.Text, 2)

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

If S = “1” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “2” Then

Txtjur.Text = “Manajemen Informatika”

ElseIf S = “3” Then

Txtjur.Text = “Tehnik Informatika”

ElseIf S = “4” Then

Txtjur.Text = “Komputer 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

Txtnu.Text = Right(Txtnpm.Text, 3)

End Sub

 

 

TUGAS 4.5

5

Private Sub Cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

 

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

 

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

Txttm.Text = “20” & Left(Txtnpm.Text, 2)

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

If S = “1” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “2” Then

Txtjur.Text = “Manajemen Informatika”

ElseIf S = “3” Then

Txtjur.Text = “Tehnik Informatika”

ElseIf S = “4” Then

Txtjur.Text = “Komputer 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

Txtnu.Text = Right(Txtnpm.Text, 3)

End Sub

Private sub txtnama_keypress(keyascii As Integer)

If keyascii =13 Then

Txtnpm.SetFocus

End If

End Sub

 

Private Sub Txtnpm_keypress(keyascii As Integer)

If keyascii = 13 Then

Txtjur.SetFocus

Dim S As String

Txttm.Text = “20” & Left(Txtnpm.Text, 2)

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

If S = “1” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “2” Then

Txtjur.Text = “Manajemen Informatika”

ElseIf S = “3” Then

Txtjur.Text = “Tehnik Informatika”

ElseIf S = “4” Then

Txtjur.Text = “Komputer 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

Txtnu.Text = Right(Txtnpm.Text, 3)

End If

End Sub

 

 

TUGAS 4.6

6

Private Sub Cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

 

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

 

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

Txttm.Text = “20” & Left(Txtnpm.Text, 2)

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

If S = “00” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “01” Then

Txtjur.Text = “Manajemen Informatika”

End If

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

If S = “1” Then

Txtprodi.Text = “Strata Satu”

ElseIf S = “2” Then

Txtprodi.Text = “Diploma Tiga”

 

End If

Txtnu.Text = Right(Txtnpm.Text, 3)

End Sub

 

 

TUGAS 4.7

7

Private Sub Cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

 

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

 

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

Txttm.Text = “20” & Left(Txtnpm.Text, 2)

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

If S = “00” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “01” Then

Txtjur.Text = “Manajemen Informatika”

End If

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

If S = “1” Then

Txtprodi.Text = “Strata Satu”

ElseIf S = “2” Then

Txtprodi.Text = “Diploma Tiga”

 

End If

Txtnu.Text = Right(Txtnpm.Text, 3)

End Sub

 

Private Sub Txtnama_keypress(keyascii As Integer)

If keyascii = 13 Then

Txtnpm.SetFocus

End If

End Sub

 

Private Sub Txtnpm_keypress(keyascii As Integer)

If keyascii = 13 Then

Dim S As String

Txttm.Text = “20” & Left(Txtnpm.Text, 2)

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

If S = “00” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “01” Then

Txtjur.Text = “Manajemen Informatika”

End If

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

If S = “1” Then

Txtprodi.Text = “Strata Satu”

ElseIf S = “2” Then

Txtprodi.Text = “Diploma Tiga”

 

End If

Txtnu.Text = Right(Txtnpm.Text, 3)

End If

End Sub

 

 

TUGAS 4.8

8

Private Sub Command2_Click()

Text1 = “”

Text2 = “”

Text3 = “”

Text4 = “”

Text5 = “”

Text6 = “”

Text1.SetFocus

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Command1_Click()

If Text1.Text = “BIM” Then

Text2.Text = 50000

Text3.Text = “BIMA”

Text4.Text = “16.00 WIB”

Text6.Text = Val(Text2.Text) * Val(Text5.Text)

ElseIf Text1.Text = “EKO” Then

Text2.Text = 35000

Text3.Text = “EKONOMI”

Text4.Text = “19.00 WIB”

Text6.Text = Val(Text2.Text) * Val(Text5.Text)

ElseIf Text1.Text = “MUT” Then

Text2.Text = 23000

Text3.Text = “MUTIARA”

Text4.Text = “17.00 WIB”

Text6.Text = Val(Text2.Text) * Val(Text5.Text)

ElseIf Text1.Text = “SEN” Then

Text2.Text = 35000

Text3.Text = “SENJA”

Text4.Text = “20.00 WIB”

Text6.Text = Val(Text2.Text) * Val(Text5.Text)

End If

End Sub

 

 

TUGAS 4.9

9

Private Sub cmdbatal_Click()

Cbokb.SetFocus

Cbokb.Text = “”

Txtjb.Text = “”

Txtpeng.Text = “”

Txttt.Text = “”

Txtpen.Text = “”

Txth.Text = “”

End Sub

Private Sub cmdkeluar_Click()

End

End Sub

Private Sub cmdlagi_Click()

Cbokb.SetFocus

Cbokb.Text = “”

Txtjb.Text = “”

Txtpeng.Text = “”

Txttt.Text = “”

Txtpen.Text = “”

Txth.Text = “”

End Sub

Private Sub cmdproses_Click()

Dim a, b, c, d As String

Dim h As Double

Txttt.Text = “20” & Right(Cbokb.Text, 2)

a = Mid(Cbokb.Text, 3, 3)

If a = “SIM” Then

b = “SISTEM INFORMASI MANAJEMEN”

c = “YATI NUR OKTAVIA”

h = “75900”

ElseIf a = “MNJ” Then

b = “MANAJEMEN”

c = “VALENTINA MARIANA ADIWIANTI”

h = “42000”

ElseIf a = “EDP” Then

b = “ELECTRONIK DATA PROCESSING”

c = “IMAM TARMIZI”

h = “62000”

ElseIf a = “CDR” Then

b = “COREL DRAW”

c = “RIYAN SUHANDI”

h = “53000”

ElseIf a = “RPL” Then

b = “REKAYASA PERANGKAT LUNAK”

c = “SINTA UMPUL SINGA”

h = “83000”

End If

Txtjb.Text = b

Txtpeng.Text = c

Txth.Text = h

d = Left(Cbokb.Text, 1)

If d = “A” Then

Txtpen.Text = “ANDI OFFSET YOGYAKARTA”

ElseIf d = “I” Then

Txtpen.Text = “INDAH SURABAYA”

ElseIf d = “M” Then

Txtpen.Text = “MAXICOM”

ElseIf d = “S” Then

Txtpen.Text = “SURYA PERMAI”

ElseIf d = “E” Then

Txtpen.Text = “ELEK MEDIA KOMPUTINDO”

End If

End Sub

Private Sub Form_Load()

Cbokb.AddItem “A-SIM-01”

Cbokb.AddItem “I-EDP-02”

Cbokb.AddItem “S-MNJ-03”

Cbokb.AddItem “E-CDR-04”

Cbokb.AddItem “M-RPL-05”

End Sub

 

 

TUGAS 4.10

10

Private Sub Cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

txtkelas.Text = “”

txtjur.Text = “”

txtprodi.Text = “”

txttm.Text = “”

txtnu.Text = “”

txtup.Text = “”

txtbps.Text = “”

txtub.Text = “”

txtbp.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

txtkelas.Text = “”

txtjur.Text = “”

txtprodi.Text = “”

txttm.Text = “”

txtnu.Text = “”

txtup.Text = “”

txtbps.Text = “”

txtub.Text = “”

txtbp.Text = “”

txttotal.Text = “”

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

 

S = Left(Txtnpm, 1)

If S = “E” Then

txtkelas.Text = “Eksekutif”

txtub.Text = “1250000”

ElseIf S = “R” Then

txtkelas.Text = “Reguler”

txtub.Text = “1000000”

End If

S = Mid(Txtnpm, 6, 2)

If S = “00” Then

txtprodi.Text = “Strata Satu”

If txtkelas.Text = “Reguler” Then

txtbps.Text = “1500000”

Else

txtbps.Text = “1900000”

End If

ElseIf S = “01” Then

txtprodi.Text = “Diploma Tiga”

If txtkelas.Text = “Reguler” Then

txtbps.Text = “1250000”

Else

txtbps.Text = “1650000”

End If

ElseIf S = “02” Then

txtprodi.Text = “Diploma Satu”

If txtkelas.Text = “Reguler” Then

txtbps.Text = “1250000”

Else

txtbps.Text = “1350000”

End If

End If

 

S = Mid(Txtnpm, 5, 1)

If S = “1” Then

txtjur.Text = “Sistem Informasi”

ElseIf S = “2” Then

txtjur.Text = “Manajemen Informatika”

ElseIf S = “3” Then

txtjur.Text = “Manajemendan Komp. Akuntansi”

End If

 

txttm.Text = “20” & Mid(Txtnpm.Text, 3, 2)

txtnu.Text = Right(Txtnpm, 3)

If txtprodi.Text = “Strata Satu” Then

txtup.Text = “200000”

txtbp.Text = “600000”

Else

If txtprodi.Text = “Diploma Tiga” Then

txtup.Text = “150000”

txtbp.Text = “600000”

Else

If txtprodi.Text = “Diploma Satu” Then

txtup.Text = “150000”

txtbp.Text = “600000”

End If

End If

End If

txttotal.Text = Val(txtup.Text) + Val(txtbps.Text) + Val(txtub.Text) + Val(txtbp.Text)

End Sub

 

Private Sub Txtnama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnpm.SetFocus

End If

End Sub

 

 

TUGAS 4.11

11

 

Private Sub Cmdbatal_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

Txtbp.Text = “”

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Txtnama.SetFocus

Txtnama.Text = “”

Txtnpm.Text = “”

Txtjur.Text = “”

Txtprodi.Text = “”

Txttm.Text = “”

Txtnu.Text = “”

Txtbp.Text = “”

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

 

Txttm.Text = “20” & Left(Txtnpm.Text, 2)

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

If S = “1” Then

Txtjur.Text = “Sistem Informasi”

ElseIf S = “2” Then

Txtjur.Text = “Teknik Informatika”

ElseIf S = “3” Then

Txtjur.Text = “Manajemen Informatika”

ElseIf S = “4” Then

Txtjur.Text = “Manajemen & Komp. Akuntansi”

End If

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

If S = “00” Then

Txtprodi.Text = “Strata Satu”

Txtbp.Text = “1950000”

ElseIf S = “01” Then

Txtprodi.Text = “Diploma Empat”

Txtbp.Text = “1750000”

ElseIf S = “02” Then

Txtprodi.Text = “Diploma Tiga”

Txtbp.Text = “1650000”

ElseIf S = “03” Then

Txtprodi.Text = “Diploma Dua”

Txtbp.Text = “1450000”

End If

Txtnu.Text = Right(Txtnpm.Text, 3)

 

End Sub

 

Private Sub Txtnama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtnpm.SetFocus

End If

End Sub

 

 

TUGAS 4.12

12

Private Sub Cbokode_Click()

Dim kk, jk, hs As String

Select Case Cbokode.Text

Case “Asus A43SA”

Txtjk.Text = “Asus A53SA-VX090D”

Txths.Text = “5500000”

Case “Asus A43SD”

Txtjk.Text = “Asus A43SD-VX052D”

Txths.Text = “4500000”

Case “Asus A43SJ”

Txtjk.Text = “Asus A43SJ-VX792D”

Txths.Text = “4300000”

Case “Asus A43TA”

Txtjk.Text = “Asus A43TA-VX034D ”

Txths.Text = “4900000”

Case “Asus A43SL”

Txtjk.Text = “Asus A43SL-VX264SL”

Txths.Text = “4300000”

Case “Apple MD311”

Txtjk.Text = “Apple MacBook Pro MD311”

Txths.Text = “19300000”

Case “Apple MD313”

Txtjk.Text = “Apple MacBook Pro MD313”

Txths.Text = “24200000”

Case “Apple MD314”

Txtjk.Text = “Apple MacBook Pro MD314”

Txths.Text = “11900000”

Case “Apple MD322”

Txtjk.Text = “Apple MacBook Pro MD322”

Txths.Text = “14700000”

Case “Apple MC965”

Txtjk.Text = “Apple MacBook Air MC965”

Txths.Text = “19300000”

End Select

End Sub

 

Private Sub Cmdhitunglagi_Click()

Cbokode.SetFocus

Cbokode.Text = “”

Txtjk.Text = “”

Txths.Text = “”

Txtjj.Text = “”

Txthp.Text = “”

Txtdiscn.Text = “”

Txttotal.Text = “”

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdproses_Click()

Txthp.Text = Val(Txtjj.Text) * Val(Txths.Text)

If Txthp.Text > 40000000 Then

Txtdiscn.Text = Val(Txthp.Text) * 0.15

ElseIf Txthp.Text > 35000000 Then

Txtdiscn.Text = Val(Txthp.Text) * 0.1

ElseIf Txthp.Text > 30000000 Then

Txtdiscn.Text = Val(Txthp.Text) * 0.5

ElseIf Txthp.Text > 25000000 Then

Txtdiscn.Text = Val(Txthp.Text) * 0.2

End If

Txttotal.Text = Val(Txthp.Text) – Val(Txtdiscn.Text)

End Sub

 

Private Sub Form_Load()

Cbokode.AddItem “Asus A43SA”

Cbokode.AddItem “Asus A43SD”

Cbokode.AddItem “Asus A43SJ”

Cbokode.AddItem “Asus A43TA”

Cbokode.AddItem “Asus A43SL”

Cbokode.AddItem “Apple MD311”

Cbokode.AddItem “Apple MD313”

Cbokode.AddItem “Apple MD314”

Cbokode.AddItem “Apple MD322”

Cbokode.AddItem “Apple MC965”

End Sub

 

 

TUGAS 4.13

13

Private Sub Cmdbatal_Click()

Txtkode.SetFocus

Txtkode.Text = “”

Txtjb.Text = “”

Txtpeng.Text = “”

Txttt.Text = “”

Txtpenerbit.Text = “”

Txtharga.Text = “”

End Sub

 

Private Sub Cmdkeluar_Click()

End

End Sub

 

Private Sub Cmdlagi_Click()

Txtkode.SetFocus

Txtkode.Text = “”

Txtjb.Text = “”

Txtpeng.Text = “”

Txttt.Text = “”

Txtpenerbit.Text = “”

Txtharga.Text = “”

End Sub

Private Sub Cmdproses_Click()

Dim S As String

Txttt.Text = “20” & Right(Txtkode, 2)

S = Mid(Txtkode, 3, 3)

If S = “SIM” Then

Txtjb.Text = “Sistem Informasi Manajemen”

Txtpeng.Text = “Andra Setiawan”

Txtharga.Text = “75900”

 

ElseIf S = “EDP” Then

Txtjb.Text = “Elektronik Data Processing”

Txtpeng.Text = “Desi Istiqomah”

Txtharga.Text = “62000”

 

ElseIf S = “MNJ” Then

Txtjb.Text = “Manajemen”

Txtpeng.Text = “Sandy Fitra jaya”

Txtharga.Text = “42000”

 

ElseIf S = “CDR” Then

Txtjb.Text = “Corel Draw”

Txtpeng.Text = “Tri Indah Sari”

Txtharga.Text = “53000”

 

ElseIf S = “RPL” Then

Txtjb.Text = “Rekayasa Perangkat Lunak”

Txtpeng.Text = “Ernita Sari”

Txtharga.Text = “83000”

End If

S = Left(Txtkode, 1)

If S = “A” Then

Txtpenerbit.Text = “Andi Offset Yogyakarta”

ElseIf S = “I” Then

Txtpenerbit.Text = “Indah Surabaya”

ElseIf S = “S” Then

Txtpenerbit.Text = “Salemba Empat”

ElseIf S = “E” Then

Txtpenerbit.Text = “Elek Media Komputindo”

ElseIf S = “M” Then

Txtpenerbit.Text = “Maxicom”

End If

End Sub

 

 

TUGAS 4.14

14

Private Sub cmdkeluar_Click()

End

End Sub

 

Private Sub cmdlagi_Click()

Txtmnk.SetFocus

Txtmnk.Text = “”

Txtmn.Text = “”

Txtgol.Text = “”

Txtks.Text = “”

Txts.Text = “”

Txtt.Text = “”

Txtj.Text = “”

Txtb.Text = “”

Txtgapok.Text = “”

Txttnj.Text = “”

Txttotal.Text = “”

End Sub

 

Private Sub cmdproses_Click()

Dim r As String

 

r = Mid(Txtmn.Text, 5, 1)

If r = “A” Then

Txtgol = “A”

Txtj.Text = “MANAGER”

Txtgapok.Text = “4000000”

Txttnj.Text = “1025000”

ElseIf r = “B” Then

Txtgol.Text = “B”

Txtj.Text = “Ka.SEKSI”

Txtgapok.Text = “3500000”

Txttnj.Text = “975000”

ElseIf r = “C” Then

Txtgol.Text = “C”

Txtj.Text = “STAFF”

Txtgapok.Text = “3000000”

Txttnj.Text = “925000”

End If

r = Right(Txtmn.Text, 3)

If r = “KEU” Then

Txtb.Text = “ACCOUNTING”

ElseIf r = “ADM” Then

Txtb.Text = “ADMINISTRASI”

ElseIf r = “SDM” Then

Txtb.Text = “GENERAL AFFAIR”

ElseIf r = “EDP” Then

Txtb.Text = “IT UNIT”

ElseIf r = “SPM” Then

Txtb.Text = “SECURITY”

End If

r = Mid(Txtmn.Text, 7, 1)

If r = “S” Then

kode = “S”

Status = “SINGEL”

ElseIf r = “M” Then

kode = “M”

Status = “MENIKAH”

ElseIf r = “J” Then

kode = “J”

Status = “JANDA”

ElseIf r = “D” Then

kode = “D”

Status = “DUDA”

End If

Txtks.Text = kode

Txts.Text = Status

Txtt.Text = Left(Txtmn.Text, 4)

Txttotal.Text = Val(Txtgapok.Text) + Val(Txttnj.Text)

End Sub

 

Private Sub Form_Activate()

Txtmnk.SetFocus

End Sub

 

Private Sub txtmnk_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Txtmn.SetFocus

End If

End Sub

 

Private Sub cmdbatal_Click()

Txtmnk.SetFocus

Txtmnk.Text = “”

Txtmn.Text = “”

Txtgol.Text = “”

Txtks.Text = “”

Txts.Text = “”

Txtt.Text = “”

Txtj.Text = “”

Txtb.Text = “”

Txtgapok.Text = “”

Txttnj.Text = “”

Txttotal.Text = “”

End Sub

 

 

Advertisements

tugas 4 menentukan gaji menurut golongan

TUGAS4

Private Sub cbogolongan_Click()
Dim gapok, tunjangan, pajak, total As Variant
Select Case Cbogolongan.Text
Case “I”
gapok = 2000000
tunjangan = 200000
Case “II”
gapok = 3000000
tunjangan = 300000
Case “III”
gapok = 4000000
tunjangan = 400000
Case “IV”
gapok = 5000000
tunjangan = 500000
Case Else
gapok = 0
tunjangan = O
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 Command1_Click()
txtnidn.SetFocus
txtnidn.Text = “”
txtnama.Text = “”
Cbogolongan.Text = “”
txtgapok.Text = “”
txttunjangan.Text = “”
txtpajak.Text = “”
txttotal.Text = “”
End Sub

Private Sub Command2_Click()
txtnidn.SetFocus
txtnidn.Text = “”
txtnama.Text = “”
Cbogolongan.Text = “”
txtgapok.Text = “”
txttunjangan.Text = “”
txtpajak.Text = “”
txttotal.Text = “”
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Cbogolongan.AddItem “I”
Cbogolongan.AddItem “II”
Cbogolongan.AddItem “III”
Cbogolongan.AddItem “IV”
End Sub

tugas 3.2 dengan fungsi enter

TUGAS3.2
Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As Integer

Select Case Cbonpm.Text
Case “14100186”
nama = “AGENG PRAYOGO”
jurusan = “sistem informasi”
Case “14100191”
nama = “IMAM SAISOHAR”
jurusan = “sistem informasi”
Case “14100190”
nama = “AHMAD SYAIFULLAH”
jurusan = “sistem informasi”
Case “14100172”
nama = “ARMINSYAH”
jurusan = “sistem informasi”
Case “14100213”
nama = “INDRI DESTRIANA”
jurusan = “sistem informasi”
Case “14100177”
nama = “JAMILAH”
jurusan = “sistem informasi”
Case “14100207”
nama = “RAIS ZULKARNAIN”
jurusan = “sistem informasi”
Case “14100247”
nama = “RATNASARI”
jurusan = “sistem informasi”
Case “14100204”
nama = “BAMBANG ARYO PAMUNGKAS”
jurusan = “sistem informasi”
Case “14100209”
nama = “WINDI SAFITRI”
jurusan = “sistem onformasi”
End Select
Txtnama.Text = nama
Txtjurusan.Text = jurusan
Txtquis.SetFocus
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 Form_Load()
Cbonpm.AddItem “14100182”
Cbonpm.AddItem “14100191”
Cbonpm.AddItem “14100190”
Cbonpm.AddItem “14100172”
Cbonpm.AddItem “14100213”
Cbonpm.AddItem “14100177”
Cbonpm.AddItem “14100207”
Cbonpm.AddItem “14100247”
Cbonpm.AddItem “14100204”
Cbonpm.AddItem “14100209”
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

Tugas 3.1 huruf mutu mahasiswa

Private Sub Cbonpm_Click()

Dim nama, jurusan, HM As Integer

Select Case CBONPM.Text

Case “14100186”

nama = “AGENG PRAYOGO”

jurusan = “sistem informasi”

Case “14100190 ”

nama = “AHMAD SYAIFULLOH”

jurusan = “sistem informasi”

Case “14100172”

nama = “ARMINSYAH”

jurusan = “sistem informasi”

Case “14100204”

nama = “BAMBANG ARYO PAMUNGKAS”

jurusan = “sistem informasi”

Case “14100206”

nama = “CATUR RESTU PUTRA”

jurusan = “sistem informasi”

Case “14100203”

nama = “DEDI MARYANTO”

jurusan = “sistem informasi”

Case “14100192”

nama = “DESMI ISKAWATI”

jurusan = “sistem informasi”

Case “14100166”

nama = “DEVI YUNITA”

jurusan = “sistem informasi”

Case “14100212”

nama = “DWI PRAYUGO”

jurusan = “manajemen informatika”

Case “14100196”

nama = “ELFIA NUR AFIFAH”

jurusan = “sistem onformasi”

End Select

TXTNAMA.Text = nama

TXTJURUSAN.Text = jurusan

TXTQUIS.SetFocus

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

CBONPM.AddItem “14100186”

CBONPM.AddItem “14100190”

CBONPM.AddItem “14100172”

CBONPM.AddItem “14100204”

CBONPM.AddItem “14100206”

CBONPM.AddItem “14100203”

CBONPM.AddItem “14100192”

CBONPM.AddItem “14100166”

CBONPM.AddItem “14100212”

CBONPM.AddItem “14100196”

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

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

Tugas 2 Property Test

IMAM2

Private Sub Check1_Click()
Label2.FontBold = Check1.Value
End Sub

Private Sub Check2_Click()
Label2.FontItalic = Check2.Value
End Sub

Private Sub Check3_Click()
Label2.FontUnderline = Check3.Value
End Sub

Private Sub Check4_Click()
Label2.FontStrikethru = Check4.Value
End Sub

Private Sub Command1_Click()
Label2.Caption = Text1.Text
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Option1_Click()
Label2.ForeColor = vbRed
End Sub

Private Sub Option2_Click()
Label2.ForeColor = vbBlue
End Sub

Private Sub Option3_Click()
Label2.ForeColor = vbGreen
End Sub

Private Sub Option4_Click()
Label2.ForeColor = vbYellow
End Sub

Tugas 4 Menentukan Gaji Diterima Menurut Golongan

TUGAS4

Private Sub cbogolongan_Click()
Dim gapok, tunjangan, pajak, total As Variant
Select Case Cbogolongan.Text
Case “I”
gapok = 2000000
tunjangan = 200000
Case “II”
gapok = 3000000
tunjangan = 300000
Case “III”
gapok = 4000000
tunjangan = 400000
Case “IV”
gapok = 5000000
tunjangan = 500000
Case Else
gapok = 0
tunjangan = O
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 Command1_Click()
txtnidn.SetFocus
txtnidn.Text = “”
txtnama.Text = “”
Cbogolongan.Text = “”
txtgapok.Text = “”
txttunjangan.Text = “”
txtpajak.Text = “”
txttotal.Text = “”
End Sub

Private Sub Command2_Click()
txtnidn.SetFocus
txtnidn.Text = “”
txtnama.Text = “”
Cbogolongan.Text = “”
txtgapok.Text = “”
txttunjangan.Text = “”
txtpajak.Text = “”
txttotal.Text = “”
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Form_Load()
Cbogolongan.AddItem “I”
Cbogolongan.AddItem “II”
Cbogolongan.AddItem “III”
Cbogolongan.AddItem “IV”
End Sub

Tugas 1 Font Color Dan Font Style

imam1

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 ChkStrike_Click()
‘membuat teks coret
If Chkstrike.Value = 1 Then
Lblteks.FontStrikethru = True
Else
Lblteks.FontStrikethru = False
End If
End Sub

Private Sub ChkUnder_Click()
‘membuat teks garis bawah
If Chkunder.Value = 1 Then
Lblteks.FontUnderline = True
Else
Lblteks.FontUnderline = False
End If
End Sub

Private Sub CmdExite_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 berwana kuning
Lblteks.ForeColor = vbYellow
End Sub