Punya Account Blogger?
Posted by Sofyan SOX on Selasa, 20 April 2010 in
Materi VB Kelas 12.3A kelompok A & B


Sub bersih()
cbkode.Text = ""
txtnama.Text = ""
cbtujuan.Text = ""
txtharga.Text = ""
txtjumlah.Text = ""
txttotal.Text = ""
txtppn.Text = ""
txtbayar.Text = ""
cbkode.SetFocus

End Sub
Private Sub cbkode_Click()
If cbkode.Text = "GA001" Then
    txtnama.Text = "Garuda Airways"
ElseIf cbkode.Text = "SA001" Then
    txtnama.Text = "Singapore Airlines"
Else
    txtnama.Text = "Mandala Airlines"
End If

End Sub

Private Sub cbtujuan_Click()
If txtnama.Text = "Garuda Airways" Then
    If cbtujuan.Text = "Domestik" Then
        txtharga.Text = 500000
    Else
        txtharga.Text = 2000000
    End If
ElseIf txtnama.Text = "Singapore Airlines" Then
    If cbtujuan.Text = "Domestik" Then
        MsgBox "Tidak Melayani Domestik", vbOKOnly, "Warning"
        bersih
    Else
        txtharga.Text = 2200000
    End If
Else
    If cbtujuan.Text = "Domestik" Then
        txtharga.Text = 400000
    Else
        MsgBox "Tidak Melayani Penerbangan LN", vbOKOnly, "Warning"
        bersih
    End If
End If

End Sub

Private Sub Command1_Click()
bersih

End Sub



Private Sub txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
txtppn.Text = 10 / 100 * Val(txttotal.Text)
txtbayar.Text = Val(txtppn.Text) + Val(txttotal.Text)
End If

End Sub
0 Responses to “Tiket Penerbangan ( Latihan If Bersarang )”:

Posting Komentar