| 0 comments




Penjelasan Program :
1.Klik Mulai untuk memulai program
2. Isi nama agar program bisa berjalan
3.Pilih Pilihan yang terdapat pada asal, tujuan, maskapai dan kelas.
4. klik buat pemesanan untuk menampilkan kode tiket, biaya, bandara

code untuk program:
Public Class Form1

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
Dim j As Integer
j = MsgBox("Anda telah dapat yang anda inginkan?", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "QUIT?")

If j = vbYes Then
End
End If
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cek.Click
Dim k As String
Dim l As String
Dim m As String

k = UCase(asal.Text)
l = UCase(tujuan.Text)
m = UCase(maskapai.Text)

Dim w As String
Dim x As String
Dim y As String
Dim z As String
Dim d As Integer

w = Microsoft.VisualBasic.Left(k, 2)
x = Microsoft.VisualBasic.Mid(l, 2, 2)
y = Microsoft.VisualBasic.Left(m, 1)

Select Case maskapai.Text
Case Is = "Garuda"
RadioButton3.Checked = True
d = " 900,000"
Case Is = "Merpati"
RadioButton2.Checked = True
d = "750,000"
Case Is = "Sriwijaya"
RadioButton1.Checked = True
d = "500,000"
Case Is = "Batavia"
d = "300,000"
Case Else
d = "250,000"
End Select

Select Case kelas.Text
Case Is = "Bisnis"
z = "0101"
d = d + "200000"
Case Is = "Ekonomi"
z = "0022"
Case Else
z = "30003"
d = d + "300000"
End Select

kode.Enabled = True
ban1.Enabled = True
ban2.Enabled = True
biaya.Enabled = True

If asal.Text = "" Then
kode.Text = ""
kode.Enabled = False
biaya.Enabled = False
ban1.Enabled = False
ban2.Enabled = False
MsgBox("Pilih asal tempat berangkat! ", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "ASAL")
Exit Sub
ElseIf tujuan.Text = "" Then
kode.Text = ""
kode.Enabled = False
biaya.Enabled = False
ban1.Enabled = False
ban2.Enabled = False
MsgBox("Pilih tujuan anda ! ", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "TUJUAN")
Exit Sub
ElseIf maskapai.Text = "" Then
kode.Text = ""
kode.Enabled = False
biaya.Enabled = False
ban1.Enabled = False
ban2.Enabled = False
MsgBox("Pilih maskapai penerbangan anda !", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "MASKAPAI")
Exit Sub
ElseIf kelas.Text = "" Then
kode.Text = ""
kode.Enabled = False
biaya.Enabled = False
ban1.Enabled = False
ban2.Enabled = False
MsgBox("Pilih kelas pesawat anda !", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "KELAS PESAWAT")
Exit Sub
ElseIf asal.Text = tujuan.Text Then
kode.Text = ""
kode.Enabled = False
biaya.Enabled = False
ban1.Enabled = False
ban2.Enabled = False
MsgBox("Jurusan dan Tujuan tak bisa sama ! ", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "TUJUAN = ASAL")
Exit Sub
End If

Select Case asal.Text
Case Is = "Bali"
ban1.Text = "Ngurah Rai"
Case Is = "Jakarta"
ban1.Text = "Soekarno-Hatta"
Case Is = "Jogjakarta"
ban1.Text = "Adi Sucipto"
Case Is = "Semarang"
ban1.Text = "Ahmad Yani"
Case Is = "Surabaya"
ban1.Text = "Juanda"
Case Is = "Medan"
ban1.Text = "polonia"
Case Is = "Manado"
ban1.Text = "Sam Ratulangi"
Case Else
ban1.Text = "Adi Sumarmo"
End Select

Select Case tujuan.Text
Case Is = "Bali"
ban2.Text = "Ngurah Rai"
Case Is = "Jakarta"
ban2.Text = "Soekarno-Hatta"
Case Is = "Jogjakarta"
ban2.Text = "Adi Sucipto"
Case Is = "Semarang"
ban2.Text = "Ahmad Yani"
Case Is = "Surabaya"
ban2.Text = "Juanda"
Case Is = "Medan"
ban2.Text = "polonia"
Case Is = "Manado"
ban2.Text = "Sam Ratulangi"
Case Else
ban2.Text = "Adi Sumarmo"
End Select

biaya.TextAlign = HorizontalAlignment.Right
kode.TextAlign = HorizontalAlignment.Center

If RadioButton1.Checked = True Then
MsgBox("Anda mendapat diskon sebesar " + RadioButton1.Text, MsgBoxStyle.Information, "DISKON 5 %")
RadioButton1.Enabled = True
RadioButton2.Enabled = False
RadioButton3.Enabled = False
biaya.Text = d - (d * 0.05)
ElseIf RadioButton2.Checked = True Then
MsgBox("Anda mendapat diskon sebesar " + RadioButton2.Text, MsgBoxStyle.Information, "DISKON 10 %")
RadioButton1.Enabled = False
RadioButton2.Enabled = True
RadioButton3.Enabled = False
biaya.Text = d - (d * 0.1)
ElseIf RadioButton3.Checked = True Then
MsgBox("Anda mendapat diskon sebesar " + RadioButton3.Text, MsgBoxStyle.Information, "DISKON 15 %")
RadioButton1.Enabled = False
RadioButton2.Enabled = False
RadioButton3.Enabled = True
biaya.Text = d - (d * 0.15)
Else
biaya.Text = d
End If

kode.Text = w + "-" + x + "-" + y + z

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mulai.Click
Me.Text = "PEMESANAN TIKET PESAWAT"

lnama.Visible = True
ganti.Visible = True
nama.Visible = True
mulai.Visible = False
asal.Visible = True
maskapai.Visible = True
tujuan.Visible = True
kelas.Visible = True
kode.Visible = True
ban1.Visible = True
ban2.Visible = True
biaya.Visible = True
RadioButton1.Visible = True
RadioButton2.Visible = True
RadioButton3.Visible = True
lasal.Visible = True
ltujuan.Visible = True
lmaskapai.Visible = True
lkelas.Visible = True
lkode.Visible = True
lban1.Visible = True
lban2.Visible = True
lbiaya.Visible = True
ldiskon.Visible = True
cek.Visible = True
keluar.Visible = True
ulang.Visible = True

MsgBox("Isi nama anda untuk memulai program ini, jika tidak, program tak akan berjalan ", MsgBoxStyle.Information, "PERINTAH AWAL")
nama.TextAlign = HorizontalAlignment.Center
nama.Text = InputBox("Nama pemesan tiket : ", "IDENTITAS")
nama.ReadOnly = True

While nama.Text = ""
MsgBox("Isi nama terlebih dahulu", MsgBoxStyle.Exclamation, "NO NAME")
nama.Text = InputBox("Nama pemesan tiket : ", "IDENTITAS")
End While

MsgBox("Harga tiap maskapai sama tiap rute penerbangan", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "INFO")
MsgBox("Jika anda memilih Garuda, diskon 15 %", MsgBoxStyle.Information, "Diskon 15%")
MsgBox("Jika anda memilih Merpati, diskon 10 %", MsgBoxStyle.Information, "Diskon 10%")
MsgBox("Jika anda memilih Sriwijaya, diskon 5 %", MsgBoxStyle.Information, "Diskon 5%")
asal.Focus()

End Sub

Private Sub ulang_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ulang.Click
asal.Text = ""
tujuan.Text = ""
maskapai.Text = ""
kelas.Text = ""
kode.Text = ""
ban1.Text = ""
ban2.Text = ""
biaya.Text = ""
RadioButton1.Checked = False
RadioButton1.Enabled = False
RadioButton2.Checked = False
RadioButton2.Enabled = False
RadioButton3.Checked = False
RadioButton3.Enabled = False
biaya.Enabled = False
kode.Enabled = False
ban1.Enabled = False
ban2.Enabled = False
End Sub

Private Sub ganti_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ganti.Click
nama.Text = InputBox("Nama anda adalah", "IDENTITAS")
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.BackColor = Color.LightSkyBlue

End Sub

Private Sub nama_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nama.TextChanged
asal.Enabled = True
tujuan.Enabled = True
maskapai.Enabled = True
kelas.Enabled = True
End Sub
End Class


Ya . segitu aja programnya