Selasa, 12 Desember 2017

Tugas 3.5 Penjualan Tiket Kerata Api oleh mahasiswa stmik pringsewu

Tugas 3.5 Penjualan Tiket Kerata Api


Berikut Source Codenya:

Private Sub Form_Activate()
txtkt.SetFocus
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

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

Private Sub cmdproses_Click()
Dim kt, jk, jb As String
Dim ht As Currency
kt = Left(txtkt.Text, 3)
If kt = "BIM" Or kt = "bim" Then
ht = "50000"
jk = "BIMA"
jb = "16.00"
ElseIf kt = "EKO" Or kt = "eko" Then
ht = "35000"
jk = "EKONOMI"
jb = "19.00"
ElseIf kt = "MUT" Or kt = "mut" Then
ht = "23000"
jk = "MUTIARA"
jb = "17.00"
ElseIf kt = "SEN" Or kt = "sen" Then
ht = "15000"
jk = "SENJA"
jb = "20.00"
End If
txtht.Text = ht
txtjk.Text = jk
txtjb.Text = jb
txtjt.SetFocus
End Sub

Private Sub txtjt_keypress(keyascii As Integer)
If keyascii = 13 Then
txttp.Text = Val(txtht.Text) * Val(txtjt.Text)
End If
End Sub

0 komentar:

Posting Komentar