TUGAS VISUAL BASIC

 

PROGRAM PENJUALAN TIKET KRETA API

 

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
txtkt.SetFocus
txtkt.Text = “”
txtht.Text = “”
txtjk.Text = “”
txtjb.Text = “”
txtjt.Text = “”
txttotalp.Text = “”
End Sub

Private Sub cmdproses_Click()
Dim KT As String
Dim T As Long
KT = Left(txtkt.Text, 3)
If KT = ” BIM” Then
txtht.Text = “50000″
txtjk.Text = “bima”
txtjb.Text = “16.00″
ElseIf KT = “EKO” Then
txtht.Text = “35000″
txtjk.Text = “ekonomi”
txtjb.Text = “19.00″
ElseIf KT = “MUT” Then
txtht.Text = “23000″
txtjk.Text = “mutiara”
txtjb.Text = “17.00″
ElseIf KT = “SEN” Then
txtht.Text = “15000″
txtjk.Text = “senja”
txtjb.Text = “20.00″
End If
txtjt.SetFocus
End Sub

Private Sub txtjt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotalp.Text = Val(txtht.Text) * (txtjt.Text)
End If
End Sub

Private Sub txtkt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdproses.SetFocus
End If
End Sub

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 )

Gambar Twitter

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

Foto Facebook

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

Foto Google+

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

Connecting to %s