Image

Iklan

Private Sub cmdbatal_Click()

TxtNAMA.SetFocus

TxtNAMA.Text = “”

txtnpm.Text = “”

txtkls.Text = “”

txtjur.Text = “”

txtprodi.Text = “”

txttm.Text = “”

txtnu.Text = “”

txtup.Text = “”

txtbps.Text = “”

txtub.Text = “”

txtbpa.Text = “”

txttotal.Text = “”

End Sub

Baca entri selengkapnya »


KODE PROGRAM

Private Sub Command1_Click()

If Right(KODE.Text, 1) = “S” Then

NAMA.Text = “SOUND SISTEM”

HRGJUAL.Text = “350000″

End If

If Right(KODE.Text, 1) = “T” Then

NAMA.Text = “TYPE”

HRGJUAL.Text = “275000″

End If

If Right(KODE.Text, 1) = “C” Then

NAMA.Text = “COMPACK”

HRGJUAL.Text = “480000″

End If

JTERJUAL.Text = Val(TERJUAL.Text) – Val(SISA.Text)

TOTAL.Text = Val(JTERJUAL.Text) – Val(HRGJUAL.Text)

End Sub

Baca entri selengkapnya »

Nama                         : Nurudin

Npm                           : 11100064

Mk                             : Visual Basic

Dosen pengampu      : Nur Aminuddin S.kom

 

 

 

 

TUGAS VISUAL BASIC 3

 

 

 

 

Jawab :

 

Private sub cmdprosess_klick()

Dim Nik As string

Nik=left(txtnik.text,1)

IfNik=”A”then

Txtgol.text=”A”

Txtjabatan.text=”manajer”

Txtgp.text=”2500000”

Txttunjangan.text=”625000”

Txttotal gaji=”3125000”

End if

Private sub cmdprosess_klick()

Dim Nik As string

Nik=left(txtNik.text,1)

IfNik=”B”then

Txtgol.text=”B”

Txtjabatan.text=”Ka.seksi”

Txtgp.text=”1500000”

Txttunjangan.text=”375000”

Txttotal gaji=”1785000”

End if

Private sub cmdprosess_klick()

Dim Nik As string

Nik=left(txtNik.text,1)

IfNik=”C”then

Txtgol.text=”C”

Txtjabatan.text=”Staff”

Txtgp.text=”1000000”

Txttunjangan.text=”250000”

Txttotal gaji=”1250000”

End if

End sub

 

Txttunjangan.setfocus

 

Nik=mid(txtNik.text,2,4)

Txttahun.text=”1993”

Nik=mid(txtNik.text,6,3)

IfNik=”KEU”then

Txtbagian.text=”Accounting”

Elseft.Nik=”ADM”then

Txtbagian.text=”Administration”

Elseft.Nik=”SDM”then

Txtbagian.text=”general affair”

Elseft.Nik=”SPM”then

Txtbagian.text=”Security”

End sub

Nik=left(txtNik.text,1)

IfNik=”S”then

Txtks.text=”S”

Txtstatus.text=”Sigle”

Elseft.Nik=”M”then

Txtks.text=”M”

Txtstatus=”Menikah”

Elseft.Nik=”D”then

Txtks.text=”D”

Txtstatus=”Duda”

Elseft.Nik=”J”then

Txtks.text=”J”

Txtstatus=”Janda”

End if

End sub

 

Private sub txtnama_keypress(keyAsciiAsinteger)

IfkeyAscii=13 then

txtNik.setfocus

end if

end sub

private sub txttunjangan_keypress(keyAsciiAsinteger)

IfkeyAscii=13 then

Dim tg As currency

Txttg=val(txtgp.text)+val(txttunjangan.text)

End if

End sub

 

 

 

 

 

 

 

 

 

Nama                    : Nurudin

Npm                      : 11100064

Mk                         : Visual Basic

Dosen Pengampu : Nur Aminuddin S.kom

 

 

 

 

                                                                                                                                                                   

Tugas Visual Basic

 

Penjualan Tiket Kereta Api :

Kode Tiket

Harga Tiket

Jenis Kereta

Jam Berangkat

Jumlah Tiket

 

Lagi               Exit

 

Jwb :

private sub txtht_keyPress(keyAsciiAs Integer)

If keyAscii = 13 then

Txtht.setfocus

End if

End sub

Jwb :

private sub txtjk_keypress(keyAsciiAs integer)

If keyAscii = 13 then

Txtjk.setfocus

End if

End sub

Jwb :

Private sub txtjb_keypress(keyAsciiAs integer)

If keyAscii = 13 then

Txtjb.setfocus

End if

End sub

Jwb :

Private sub txtjt_keypress(keyAsciiAs integer)

If keyAscii = 13 then

Txtjb.setfocus

End if

End sub

 

 

 TUGAS VISUAL BASIC

 

JENIS KERETA,HARGA TIKET,JAM  BERANGKAT :

Bila kode tiket diawali BIM,maka di isi BIMA harga tiket 50.000,jam berangkat  16.00

Bila kode tiket diawali EKO,maka di isi EKONAMI harga tiket 35.000,jam berangkat  19.00

Bila kode tiket diawali MUT,maka di isi MUTIARA harga tiket 23.000,jam berangkat  17.00

Bila kode tiket diawali SEN,maka di isi SENJA harga tiket 15.000,jam berangkat  20.00

 

JUMLAH TIKET = JUMLAH

TOTAL PEMASUKAN = HARGA TIKET*JUMLAH TIKET

 

Jwb :

Private sub cmdpress_klick ( )

Dim S Asstring

S=left(txtkt.text,3)

If S=“BIM”

Txtht.text =“50.000”

Txtjk.text =“BIMA”

Txtjb.text =“16.00”

Txtjt.text =“5”

Txttotalp =“250000”

End sub

 

Private sub cmdpress_klick ( )

Dim S Asstring

S=left(txtkt.text,3)

If S=”EKO”

Txtht.text=”35.000”

Txtjk.text=”EKONOMI”

Txtjb.text=”19.00”

Txtjt.text=”5”

Txttotalp=”175000”

End sub

 

Private sub cmdpress_klick ( )

Dim S Asstring

S=left(txtkt.text,3)

If S=”MUT”

Txtht.text=”23.000”

Txtjk.text=”MUTIARA”

Txtjb.text=”17.00”

Txtjt.text=”5”

Txttotalp=”115000”

End sub

 

Private sub cmdpress_klick ( )

Dim S Asstring

S=left(txtkt.text,3)

If S=”SEN”

Txtht.text=”15000”

Txtjk.text=”SENJA”

Txtjb.text=”20.00”

Txtjt.text=”5”

Txttotalp=”75000”

End sub

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.