tugas vb 5 program

ASISCA 5 PRG (LEPTOP) ASISCA 5 PRG DATABUKU ASISCA 5 PRG NPM HARGA ASISCA 5 PRG NPM STRATA ASISCA 5 PRG PT PLANG

 

 

  1. Tugas No.1

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub Cmdlagi_Click()

Text1.SetFocus

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text7.Text = “”

Text8.Text = “”

Text9.Text = “”

Text10.Text = “”

Text11.Text = “”

Text12.Text = “”

End Sub

 

Private Sub Cmdbatal_Click()

Text1.SetFocus

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text7.Text = “”

Text8.Text = “”

Text9.Text = “”

Text10.Text = “”

Text11.Text = “”

Text12.Text = “”

End Sub

 

Private Sub Cmdproses_Click()

Dim S As String

Text6.Text = “20” & Mid(Text2.Text, 3, 2)

S = Mid(Text2.Text, 1, 1)

If S = “E” Then

Text3.Text = “EKSEKUTIF”

Text10.Text = “1250000”

Text11.Text = “600000”

ElseIf S = “R” Then

Text3.Text = “REGULER”

Text10.Text = “1000000”

Text11.Text = “600000”

End If

S = Mid(Text2.Text, 5, 1)

If S = “1” Then

Text4.Text = “Sistem Informasi”

ElseIf S = “2” Then

Text4.Text = “Manajemen Informatika”

ElseIf S = “3” Then

Text4.Text = “Manajemen dan Komp. Akuntansi”

End If

S = Mid(Text2.Text, 6, 2)

If S = “01” Then

Text5.Text = “Strata Satu”

Text8.Text = “200000”

ElseIf S = “02” Then

Text5.Text = “Diploma Tiga”

Text8.Text = “150000”

ElseIf S = “03” Then

Text5.Text = “Diploma Satu”

Text8.Text = “150000”

End If

S = Mid(Text2.Text, 1, 1) & Mid(Text2.Text, 6, 2)

If S = “E” & “01” Then

Text9.Text = “1900000”

ElseIf S = “E” & “02” Then

Text9.Text = “1650000”

ElseIf S = “E” & “03” Then

Text9.Text = “1350000”

ElseIf S = “R” & “01” Then

Text9.Text = “1500000”

ElseIf S = “R” & “02” Then

Text9.Text = “1250000”

ElseIf S = “R” & “03” Then

Text9.Text = “1250000”

End If

Text7.Text = Right(Text2.Text, 3)

TOTAL = Val(Text8.Text) + Val(Text9.Text) + Val(Text10.Text) + Val(Text11.Text)

Text12.Text = TOTAL

End Sub

 

Private Sub text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

 

  1. Tugas No.2

 

Private Sub cmdkeluar_Click()

Unload Me

End Sub

 

Private Sub cmdlagi_Click()

txtnama.SetFocus

txtnama.Text = “”

txtnpm.Text = “”

txtjurusan.Text = “”

txtpstudi.Text = “”

txttahun.Text = “”

txtnurut.Text = “”

txtbp.Text = “”

txtterbilang.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 = “Teknik Informasi”

ElseIf S = “3” Then

txtjurusan.Text = “Manajemen Informatika”

ElseIf S = “4” Then

txtjurusan.Text = “Manajemen & Komp. Akuntansi”

End If

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

If S = “1” Then

txtpstudi.Text = “Strata Satu”

txtbp.Text = “1950000”

ElseIf S = “2” Then

txtpstudi.Text = “Diploma Tiga”

txtbp.Text = “1750000”

ElseIf S = “3” Then

txtpstudi.Text = “Diploma Empat”

txtbp.Text = “1650000”

ElseIf S = “4” Then

txtpstudi.Text = “Diploma Dua”

txtbp.Text = “1450000”

End If

txtnurut.Text = Right(txtnpm.Text, 3)

End Sub

 

 

Private Sub txtbp_Change()

txtterbilang.Text = terbilang(Val(txtbp.Text))

End Sub

 

Private Sub txtnama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtnpm.SetFocus

End If

End Sub

 

Private Function baca(X As Integer) As String

Dim i As Long

Dim ratus(9) As String

Dim belas(9) As String

Dim puluh(9) As String

Dim satuan(9) As String

Dim sbaca As String

satuan(1) = “satu”

satuan(2) = “dua”

satuan(3) = “tiga”

satuan(4) = “empat”

satuan(5) = “lima”

satuan(6) = “enam”

satuan(7) = “tujuh”

satuan(8) = “delapan”

satuan(9) = “sembilan”

For i = 1 To 9

If i = 1 Then

puluh(i) = “sepuluh”

Else

puluh(i) = satuan(i) & ” puluh”

End If

Next

For i = 1 To 9

If i = 1 Then

belas(i) = “sebelas”

Else

belas(i) = satuan(i) & ” belas”

End If

Next

For i = 1 To 9

If i = 1 Then

ratus(i) = “seratus”

Else

ratus(i) = satuan(i) & ” ratus”

End If

Next

If X >= 100 Then

sbaca = ratus(Val(Mid(Str(X), 2, 1)))

X = Val(Mid(Str(X), 3, 2))

End If

If X >= 20 Or X = 10 Then

sbaca = sbaca & ” ” & puluh(Val(Mid(Str(X), 2, 1)))

X = Val(Mid(Str(X), 3, 1))

Else

If X > 10 Then

sbaca = sbaca & ” ” & belas(Val(Mid(Str(X), 3, 1)))

X = -1

End If

End If

If X >= 1 Then

sbaca = sbaca & ” ” & satuan(Val((Str(X))))

End If

baca = sbaca

End Function

Function terbilang(X As Currency) As String

Dim ribu, juta, milyar, trilyun, ratusan As Integer

Dim sterbilang As String

Dim ptext As Byte

sterbilang = “”

If Val(X) = 1000000000000# Then

ptext = Len(Str(X)) – 13

trilyun = Val(Mid(Str(X), 2, ptext))

sterbilang = sterbilang & ” ” & baca(Val(trilyun)) & ” trilyun”

X = Val(Mid(Str(X), ptext + 2, 12))

End If

If X >= 1000000000 Then

ptext = Len(Str(X)) – 10

milyar = Val(Mid(Str(X), 2, ptext))

sterbilang = sterbilang & ” ” & baca(Val(milyar)) & ” milyar”

X = Val(Mid(Str(X), ptext + 2, 9))

End If

If X >= 1000000 Then

ptext = Len(Str(X)) – 7

juta = Val(Mid(Str(X), 2, ptext))

sterbilang = sterbilang & ” ” & baca(Val(juta)) & ” juta”

X = Val(Mid(Str(X), ptext + 2, 6))

End If

If X >= 1000 Then

ptext = Len(Str(X)) – 4

ribu = Val(Mid(Str(X), 2, ptext))

If ribu = 1 Then

sterbilang = “seribu”

Else

sterbilang = sterbilang & ” ” & baca(Val(ribu)) & ” ribu”

End If

X = Val(Mid(Str(X), ptext + 2, 3))

End If

sterbilang = sterbilang & ” ” & baca(Val(X))

terbilang = Trim(sterbilang) & ” rupiah”

End Function

 

  1. Tugas No. 3

 

Private Sub Combo1_Click()

Text3.SetFocus

End Sub

 

Private Sub Command1_Click()

Dim H As String

H = Mid(Combo1.Text, 7, 5)

If H = “MC965” Then

Text1.Text = “Apple MacBook Air MC965”

Text2.Text = 12800000

ElseIf H = “MC966” Then

Text1.Text = “Apple MacBook Air MC966”

Text2.Text = 15800000

ElseIf H = “MC968” Then

Text1.Text = “Apple MacBook Air MC968”

Text2.Text = 9900000

ElseIf H = “MC969” Then

Text1.Text = “Apple MacBook Air MC969”

Text2.Text = 11900000

ElseIf H = “MC700” Then

Text1.Text = “Apple MacBook Pro MC700”

Text2.Text = 10800000

ElseIf H = “MC721” Then

Text1.Text = “Apple MacBook Pro MC721”

Text2.Text = 15900000

ElseIf H = “MC723” Then

Text1.Text = “Apple MacBook Pro MC723”

Text2.Text = 19300000

ElseIf H = “MC724” Then

Text1.Text = “Apple MacBook Pro MC724”

Text2.Text = 13700000

ElseIf H = “MC311” Then

Text1.Text = “Apple MacBook Pro MC311”

Text2.Text = 24200000

ElseIf H = “MC313” Then

Text1.Text = “Apple MacBook Pro MC313”

Text2.Text = 11900000

ElseIf H = “MC314” Then

Text1.Text = “Apple MacBook Pro MC314”

Text2.Text = 14700000

ElseIf H = “MC318” Then

Text1.Text = “Apple MacBook Pro MC318”

Text2.Text = 17600000

ElseIf H = “MC322” Then

Text1.Text = “Apple MacBook Pro MC322”

Text2.Text = 21300000

End If

Text4.Text = Val(Text2.Text) * Val(Text3.Text)

If Text4.Text >= 15000000 Then

Text5.Text = Val(Text4.Text) * 2 / 100

ElseIf Text4.Text <= 25000000 Then

Text5.Text = Val(Text4.Text) * 5 / 100

ElseIf Text4.Text <= 30000000 Then

Text5.Text = Val(Text4.Text) * 10 / 100

ElseIf Text4.Text > 30000000 Then

Text5.Text = Val(Text4.Text) * 15 / 100

End If

Text6.Text = Val(Text4.Text) – Val(Text5.Text)

End Sub

 

Private Sub Command2_Click()

Combo1.SetFocus

Combo1.Text = “”

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

Private Sub Form_Load()

Combo1.AddItem “Apple MC965 MacBook Air”

Combo1.AddItem “Apple MC966 MacBook Air”

Combo1.AddItem “Apple MC968 MacBook Air”

Combo1.AddItem “Apple MC969 MacBook Air”

Combo1.AddItem “Apple MC700 MacBook Pro”

Combo1.AddItem “Apple MC721 MacBook Pro”

Combo1.AddItem “Apple MC723 MacBook Pro”

Combo1.AddItem “Apple MC724 MacBook Pro”

Combo1.AddItem “Apple MC311 MacBook Pro”

Combo1.AddItem “Apple MC313 MacBook Pro”

Combo1.AddItem “Apple MC314 MacBook Pro”

Combo1.AddItem “Apple MC318 MacBook Pro”

Combo1.AddItem “Apple MC322 MacBook Pro”

End Sub

 

 

 

  1. Tugas No.4

Private Sub Cmdproses_Click()

Dim K As String

K = Mid(txtkb.Text, 3, 3)

If K = “SIM” Then

txtjb.Text = “SISTEM INFORMASI MANAJEMEN”

txtp.Text = “ANDRA SETIAWAN”

txthg.Text = “75900”

ElseIf K = “EDP” Then

txtjb.Text = “ELEKTRONIK DATA PROCESSING”

txtp.Text = “DESI ISTIQOMAH”

txthg.Text = “62000”

ElseIf K = “MNJ” Then

txtjb.Text = “MANAJEMEN”

txtp.Text = “SANDY FITRAJAYA”

txthg.Text = “42000”

ElseIf K = “CDR” Then

Txjb.Text = “COREL DRAW”

txtp.Text = “TRI INDAHSARI”

txthg.Text = “53000”

ElseIf K = “RPL” Then

txtjb.Text = “REKAYASA PERANGKAT LUNAK”

txtp.Text = “ERNITA SARI”

txthg.Text = “83000”

End If

K = Mid(txtkb.Text, 1, 1)

If K = “A” Then

txtpenerbit.Text = “ANDI OFFSET YOGYAKARTA”

ElseIf K = “I” Then

txtpenerbit.Text = “INDAH SURABAYA”

ElseIf K = “S” Then

txtpenerbit.Text = “SALEMBA EMPAT”

ElseIf K = “E” Then

txtpenerbit.Text = “ELEK MEDIA KOMPUTINDO”

ElseIf K = “M” Then

txtpenerbit.Text = “MAXICOM”

End If

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

End Sub

 

Private Sub Cmdlagi_Click()

txtkb.SetFocus

txtjb.Text = “”

txtp.Text = “”

txthg.Text = “”

txtpenerbit.Text = “”

txttahun.Text = “”

txtkb.Text = “”

End Sub

 

Private Sub Cmdbatal_Click()

txtkb.SetFocus

txtjb.Text = “”

txtp.Text = “”

txthg.Text = “”

txtpenerbit.Text = “”

txttahun.Text = “”

txtkb.Text = “”

End Sub

 

Private Sub Cmdkeluar_Click()

Unload Me

End Sub

 

 

 

 

  1. Tugas No. 5

 

Private Sub cmdcancel_Click()

txtnama.SetFocus

txtnama.Text = “”

txtNIK.Text = “”

txtgol.Text = “”

txtKS.Text = “”

txtS.Text = “”

txtTH.Text = “”

Txtjab.Text = “”

txtbag.Text = “”

txtGP.Text = “”

txtTJ.Text = “”

txtTG.Text = “”

End Sub

Private Sub cmdexit_Click()

End

End Sub

Private Sub cmdlagi_Click()

txtnama.SetFocus

txtnama.Text = “”

txtNIK.Text = “”

txtgol.Text = “”

txtKS.Text = “”

txtS.Text = “”

txtTH.Text = “”

Txtjab.Text = “”

txtbag.Text = “”

txtGP.Text = “”

txtTJ.Text = “”

txtTG.Text = “”

End Sub

Private Sub cmdproses_Click()

Dim kode, status, jabatan As Integer

Dim gaji, tunjangan As Currency

jbt = Mid(txtNIK.Text, 5, 1)

If jbt = “A” Then

jbt = “MANAGER”

gol = “I”

gaji = “5000000”

tunjangan = “1000000”

ElseIf jbt = “B” Then

jbt = “Ka.SEKSI”

gol = “II”

gaji = “4000000”

tunjangan = “750000”

ElseIf jbt = “C” Then

jbt = “STAFF”

gol = “III”

gaji = “3000000”

tunjangan = “500000”

End If

 

BAG = Mid(txtNIK.Text, 7, 3)

If BAG = “KEU” Then

txtbag.Text = “ACCOUNTING”

ElseIf BAG = “ADM” Then

txtbag.Text = “ADMINISTRASI”

ElseIf BAG = “SDM” Then

txtbag.Text = “GENERAL AFFAIR”

ElseIf BAG = “EDP” Then

txtbag.Text = “IT UNIT”

ElseIf BAG = “SPM” Then

txtbag.Text = “SECURITY”

End If

 

kode = Mid(txtNIK.Text, 3, 1)

If kode = “S” Then

kode = “S”

status = “SINGLE”

ElseIf kode = “M” Then

kode = “M”

status = “MENIKAH”

ElseIf kode = “J” Then

kode = “J”

status = “JANDA”

ElseIf kode = “D” Then

kode = “D”

status = “DUDA”

End If

Txtjab.Text = jbt

txtGP.Text = gaji

txtTJ.Text = tunjangan

txtKS.Text = kode

txtS.Text = status

txtgol.Text = gol

txtTH.Text = “20” & Left(txtNIK.Text, 2)

txtTG.Text = Val(txtGP.Text) + Val(txtTJ.Text)

End Sub

Private Sub Form_Activate()

txtnama.SetFocus

End Sub

 

Private Sub txtnama_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtNIK.SetFocus

End If

End Sub

 

Iklan

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s