Tugas VB 10

VB

Private Sub CmdBatal_Click()
TxtNama.SetFocus
TxtNama.Text = ” ”
TxtNPM.Text = ” ”
TxtKelas.Text = ” ”
TxtJurusan.Text = ” ”
TxtPs.Text = ” ”
TxtTm.Text = ” ”
TxtNorut.Text = ” ”
TxtUpend.Text = ” ”
TxtBipend.Text = ” ”
TxtUbang.Text = ” ”
TxtBipro.Text = ” ”
TxtTobi.Text = ” ”
End Sub

Private Sub CmdKeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
TxtNama.SetFocus
TxtNama.Text = ” ”
TxtNPM.Text = ” ”
TxtKelas.Text = ” ”
TxtJurusan.Text = ” ”
TxtPs.Text = ” ”
TxtTm.Text = ” ”
TxtNorut.Text = ” ”
TxtUpend.Text = ” ”
TxtBipend.Text = ” ”
TxtUbang.Text = ” ”
TxtBipro.Text = ” ”
TxtTobi.Text = ” ”
End Sub

Private Sub cmdproses_Click()
Dim a As String

a = Left(TxtNPM.Text, 1)
If a = “E” Or a = “e” Then
TxtKelas.Text = “Eksekutif”
TxtUbang.Text = “1250000”
ElseIf a = “R” Or a = “r” Then
TxtKelas.Text = “Reguler”
TxtUbang.Text = “1000000”
End If

TxtBipro.Text = “600000”

a = Mid(TxtNPM.Text, 5, 1)
If a = “1” Then
TxtJurusan.Text = “Sistem Informasi”
ElseIf a = “2” Then
TxtJurusan.Text = “Manajemen Informatika”
ElseIf a = “3” Then
TxtJurusan.Text = “Manajemen dan Komp.Akutansi”
End If

a = Mid(TxtNPM.Text, 6, 2)
If a = “01” Then
TxtPs.Text = “Strata Satu”
TxtUpend.Text = “200000”
ElseIf a = “02” Then
TxtPs.Text = “Diploma Tiga”
TxtUpend.Text = “150000”
ElseIf a = “03” Then
TxtPs.Text = “Diploma Satu”
TxtUpend.Text = “150000”
End If
TxtNorut.Text = Right(TxtNPM.Text, 3)

TxtTm.Text = “20” & Mid(TxtNPM.Text, 3, 2)

If TxtKelas.Text = “Eksekutif” And TxtPs.Text = “Strata Satu” Then
TxtBipend.Text = “1900000”
ElseIf TxtKelas.Text = “Eksekutif” And TxtPs.Text = “Diploma Tiga” Then
TxtBipend.Text = “1650000”
ElseIf TxtKelas.Text = “Eksekutif” And TxtPs.Text = “Diploma Satu” Then
TxtBipend.Text = “1350000”
ElseIf TxtKelas.Text = “Reguler” And TxtPs.Text = “Strata Satu” Then
TxtBipend.Text = “1500000”
ElseIf TxtKelas.Text = “Reguler” And TxtPs.Text = “Diploma Tiga” Then
TxtBipend.Text = “1250000”
ElseIf TxtKelas.Text = “Reguler” And TxtPs.Text = “Diploma Satu” Then
TxtBipend.Text = “1250000”
End If
TxtTobi.Text = Val(TxtUpend.Text) + Val(TxtBipend.Text) + Val(TxtUbang.Text) + Val(TxtBipro.Text)
End Sub
Private Sub Form_Activate()
TxtNama.SetFocus
End Sub

Private Sub txtNama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtNPM.SetFocus
End If
End Sub

Advertisements

PT Pulang Petang Setiap Hari

tugas 4 n0 2

Private Sub Cmdbatal_Click()
Txtnama.SetFocus
Txtnama = “”
txtnik = “”
Txtgol = “”
Txtks = “”
txts = “”
txtth = “”
txtjb = “”
txtbg = “”
txtgp = “”
txttun = “”
txttg = “”
End Sub

Private Sub Cmdkeluar_Click()
End

End Sub

Private Sub Cmdlagi_Click()
Txtnama.SetFocus
Txtnama = “”
txtnik = “”
Txtgol = “”
Txtks = “”
txts = “”
txtth = “”
txtjb = “”
txtbg = “”
txtgp = “”
txttun = “”
txttg = “”
End Sub

Private Sub cmdproses_Click()
Dim a As String
a = Mid(txtnik.Text, 5, 1)
If a = “A” Then
Txtgol = “A”
txtjb.Text = “MANAGER”
txtgp.Text = “4000000”
txttun.Text = “1025000”
ElseIf a = “B” Then
Txtgol.Text = “B”
txtjb.Text = “Ka.SEKSI”
txtgp.Text = “3500000”
txttun.Text = “975000”
ElseIf a = “C” Then
Txtgol.Text = “C”
txtjb.Text = “STAFF”
txtgp.Text = “3000000”
txttun.Text = “925000”
End If
a = Right(txtnik.Text, 3)
If a = “KEU” Then
txtbg.Text = “ACCOUNTING”
ElseIf a = “ADM” Then
txtbg.Text = “ADMINISTRASI”
ElseIf a = “SDM” Then
txtbg.Text = “GENERAL AFFAIR”
ElseIf a = “EDP” Then
txtbg.Text = “IT UNIT”
ElseIf a = “SPM” Then
txtbg.Text = “SECURITY”
End If
a = Mid(txtnik.Text, 7, 1)
If a = “S” Then
ks = “S”
S = “SINGLE”
ElseIf a = “M” Then
ks = “M”
S = “MENIKAH”
ElseIf a = “J” Then
ks = “J”
S = “JANDA”
ElseIf a = “D” Then
ks = “D”
S = “DUDA”
End If
Txtks.Text = ks
txts.Text = S
txtth.Text = Left(txtnik.Text, 4)
txttg.Text = Val(txtgp.Text) + Val(txttun.Text)
End Sub
Private Sub Txtmnk_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnik.SetFocus
End If
End Sub

 

Entri Penjualan Laptop APPLE

Tugas 4

Private Sub cbokode_Change()
Case “APPLE MC965”
Txtmerk.Text = “APPLE MACBOOK AIR MC965”
Txths.Text = “12800000”
Case “APPLE MC966”
Txtmerk.Text = “APPLE MACBOOK AIR MC966”
Txths.Text = “15800000”
Case “APPLE MC968”
Txtmerk.Text = “APPLE MCBOOK AIR MC968”
Txths.Text = “9900000”
Case “APPLE MC969”
Txtmerk.Text = “APPLE MCBOOK AIR MC969”
Txths.Text = “11900000”
Case “APPLE MC700”
Txtmerk.Text = “APPLE MACBOOK PRO MC700”
Txths.Text = “10800000”
Case “APPLE MC721”
Txtmrek.Text = “Apple MacBook PRO MC721”
Txths.Text = “15900000”
Case “APPLE MC723”
Txtmerk.Text = “APPLE MACBOOK PRO MC723”
Txths.Text = “19300000”
Case “APPLE MC724”
Txtmerk.Text = “Apple MacBook Pro MC724”
Txths.Text = “13700000”
Case “APPLE MC311”
Txtmerk.Text = “APPLE MACBOOK PRO MC311”
Txths.Text = “24200000”
Case “APPLE MC313”
Txtmerk.Text = “APPLE MACBOOK PRO MC313”
Txths.Text = “11900000”
Case “APPLE MC314”
Txtmerk.Text = “APPLE MACBOOK PRO MC314”
Txths.Text = “14700000”
Case “APPLE MC318”
Txtmerk.Text = “APPLE MACBOOK PRO MC318”
Txths.Text = “17600000”
Case “APPLE MC322”
Txtmerk.Text = “APPLE MACBOOK PRO MC322”
Txths.Text = “21300000”
Case “APPLE MC965”
Txtmerk.Text = “Apple MacBook Air MC965”
Txths.Text = “12800000”
Case “APPLE MC966”
Txtmerk.Text = “Apple MacBook Air MC966”
Txths.Text = “15800000”
End Select
Txtjj.SetFocus
End Sub

Private Sub Cmdhitunglagi_Click()
cbokode.Text = “”
Txtmerk.Text = “”
Txths.Text = “”
Txtjj.Text = “”
Txthp.Text = “”
Txtdis.Text = “”
Txttb.Text = “”
End Sub

Private Sub Cmdkeluar_Click()
End
End Sub

Private Sub Cmdproses_Click()
Dim merk As String
Dim harga, a, b, s, e As Variant
kode = Mid(cbokode.Text, 7, 5)
If kode = “MC965” Then
merk = “Apple MacBook Air MC965”
harga = “12800000”
ElseIf kode = “MC966” Then
merk = “Apple MacBook Air MC966”
harga = “15800000”
ElseIf kode = “MC968” Then
merk = “Apple MacBook Air MC968”
harga = “9900000”
ElseIf kode = “MC969” Then
merk = “Apple MacBook Air MC969”
harga = “11900000”
ElseIf kode = “MC700” Then
merk = “Apple MacBook Pro MC700”
harga = “10800000”
ElseIf kode = “MC721” Then
merk = “Apple MacBook Pro MC721”
harga = “15900000”
ElseIf kode = “MC723” Then
merk = “Apple MacBook Pro MC723”
harga = “19300000”
ElseIf kode = “MC724” Then
merk = “Apple MacBook Pro MC724”
harga = “13700000”
ElseIf kode = “MC311” Then
merk = “Apple MacBook Pro MC311”
harga = “24200000”
ElseIf kode = “MC313” Then
merk = “Apple MacBook Pro MC313”
harga = “11900000”
ElseIf kode = “MC314” Then
merk = “Apple MacBook Pro MC314”
harga = “14700000”
ElseIf kode = “MC318” Then
merk = “Apple MacBook Pro MC318”
harga = “17600000”
ElseIf kode = “MC322” Then
merk = “Apple MacBook Pro MC322”
harga = “21300000”
ElseIf kode = “MC965” Then
merk = “Apple MacBook Ari MC965”
harga = “12800000”
ElseIf kode = “MC966” Then
merk = “Apple MacBook Ari MC966”
harga = “15800000”
End If
Txtmerk.Text = merk
Txths.Text = harga

a = Val(Txths.Text)
b = Val(Txtjj.Text)
penjualan = a * b
Txthp.Text = penjualan
Select Case Txthp.Text
Case Is > 140000000
discount = 0.15 * penjualan
Case Is > 135000000
discount = 0.1 * penjualan
Case Is > 130000000
discount = 0.05 * penjualan
Case Is > 125000000
discount = 0.02 * penjualan
End Select
Txtdis.Text = discount
Txthp.Text = penjualan
s = Val(Txthp.Text)
e = Val(Txtdis.Text)
total = s + e
Txttb.Text = 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”
cbokode.AddItem “Apple MC965 MacBook Air”
cbokode.AddItem “Apple MC966 MacBook Air”
End Sub

tugas 4

evi

Private Sub cmdproses_Click()

 

kodetiket = Left(txtkt.Text, 3)

 

If kodetiket = “bim” Then

jeniskereta = “bima”

hatgatiket = “50000”

jamberangkat = “16.00”

ElseIf kodetiket = “eko” Then

jeniskereta = “ekonomi”

hargatiket = “35000”

jamberangkat = “19.00”

ElseIf kodetiket = “mut” Then

jeniskereta = “mutiara”

hargatiket = “23000”

jamberangkat = “17.00”

ElseIf kodetiket = “sen” Then

jeniskereta = “senja”

hargatiket = “15000”

jamberangkat = “20000”

 

End If

txtkt.Text = kodetiket

txtjk.Text = jeniskereta

txtht.Text = hargatiket

txtjb.Text = jamberangkat

 

txtjt.SetFocus

 

End Sub

 

Private Sub Form_Activate()

txtkt.SetFocus

End Sub

 

 

Private Sub txtjt_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txttotalp.Text = Val(txtht.Text) * Val(txtjt.Text)

End If

End Sub

 

Private Sub txtkt_Change()

 

End Sub

APLIKASI PERHITUNGAN GAJIH

Untitled- 4

Private Sub CmdKeluar_Click()
End
End Sub

Private Sub CmdProses_Click()

Txt4.Text = Val(Txt1.Text) + Val(Txt2.Text) – Val(Txt3.Text)
Txt5.Text = Val(Txt4.Text) * (0.1)
Txt6.Text = Val(Txt5.Text) – Val(Txt4.Text)
End Sub
Private Sub CmdUlang_Click()
Txt1 = ” ”
Txt2 = ” ”
Txt3 = ” ”
Txt4 = ” ”
Txt5 = ” ”
Txt6 = ” ”
txt7 = ” ”
End Sub

Private Sub Txt1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt2.SetFocus
End If
End Sub
Private Sub Txt2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt3.SetFocus
End If
End Sub

Private Sub Txt3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt4.SetFocus
End If

HURUF MUTU MAHASISWA STMIK

Untitled-19

Private Sub Cbo1_Click()
Dim NM, JR, HM As String
Select Case Cbo1.Text
Case “10201023”
NM = “SUROTO”
JR = “MANAJEMEN INFORMATIKA”
Case “10201124”
NM = “NEKO NEKO”
JR = “SISTEM INFORMASI”
End Select
Txt1.Text = NM
Txt2.Text = JR
End Sub

Private Sub Cmd1_Click()
Dim NR As Integer
Dim HM As Integer
QUIS = Val(Txt3.Text)
TUGAS = Val(Txt4.Text)
UTS = Val(Txt5.Text)
UAS = Val(Txt6.Text)
NR = (QUIS + TUGAS + UTS + UAS) / 4
Txt7.Text = NR
Txt8.Text = HM
Select Case Txt7.Text
Case Is > 80
MUTU = “A”
Case Is > 70
MUTU = “B”
Case Is > 60
MUTU = “C”
Case Is > 50
MUTU = “D”
Case Is < 50
End Select
Txt8.Text = MUTU
End Sub
Private Sub Cmd2_Click()
Cbo1.SetFocus
Cbo1.Text = “PILIH NPM”
Txt1.Text = ” ”
Txt2.Text = ” ”
Txt3.Text = ” ”
Txt4.Text = ” ”
Txt5.Text = ” ”
Txt6.Text = ” ”
Txt7.Text = ” ”
Txt8.Text = ” ”
End Sub
Private Sub Cmd3_Click()
Unload Me
End Sub

Private Sub Form_Load()
Cbo1.AddItem “10201023”
Cbo1.AddItem “10201124”
End Sub

Private Sub Txt3_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt4.SetFocus
End If
End Sub

Private Sub Txt4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt5.SetFocus
End If
End Sub
Private Sub Txt5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txt6.SetFocus
End If
End Sub
Private Sub Txt6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Cmd1.SetFocus
End If
End Sub

PERHITUNGAN HARGA SETELAH DISKON 10%

Gambar 3

Private Sub cmdHitung_Click()
Dim a, b, c As Double
a = Val(TxtAwal.Text)
b = (a * 0.1)
c = (a – b)
TxtDiskon.Text = b
TxtAkhir.Text = c
End Sub
Private Sub cmdQuit_Click()
End
End Sub
Private Sub cmdUlangi_Click()
TxtAwal.SetFocus
TxtAwal = ” ”
TxtDiskon = ” ”
TxtAkhir = ” ”
End Sub
Private Sub txtAwal_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
TxtDiskon.SetFocus
End If
End Sub
Private Sub txtDiskon_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtAhir.SetFocus
End If
End Sub