Penjelasan :
Aplikasi sederhana yang saya buat adalah tentang sebuah perusahaan jasa transportasi bus. dimana terdapat 4 kota tujuan yaitu Jakarta,Bandung,Palembang dan Dumai. Bus yang disediakan terdiri dari 3 class yaitu Bisnis, Executive dan Super Executive .
Untuk pemesanan tiket, bagi penumpang yang membeli tiket sebanyak 3 tiket atau lebih mendapat diskon 10% untuk masing-masing tiket .
Screenshot :
Coding :
Public Class Form1
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.Text = "BUKITTINGGI - PADANG - JAKARTA" Then
TextBox1.Text = 200000
TextBox2.Text = 250000
TextBox3.Text = 300000
ElseIf ComboBox1.Text = "BUKITTINGGI - PADANG - BANDUNG" Then
TextBox1.Text = 250000
TextBox2.Text = 300000
TextBox3.Text = 350000
ElseIf ComboBox1.Text = "BUKITTINGGI - PADANG - PALEMBANG" Then
TextBox1.Text = 150000
TextBox2.Text = 200000
TextBox3.Text = 250000
ElseIf ComboBox1.Text = "BUKITTINGGI - DUMAI" Then
TextBox1.Text = 100000
TextBox2.Text = 150000
TextBox3.Text = 200000
ElseIf ComboBox1.Text = "JAKARTA - PADANG - BUKITTINGGI" Then
TextBox1.Text = 200000
TextBox2.Text = 250000
TextBox3.Text = 300000
ElseIf ComboBox1.Text = "BANDUNG - PADANG - BUKITTINGGI" Then
TextBox1.Text = 250000
TextBox2.Text = 300000
TextBox3.Text = 350000
ElseIf ComboBox1.Text = "PALEMBANG - PADANG - BUKITTINGGI" Then
TextBox1.Text = 150000
TextBox2.Text = 200000
TextBox3.Text = 250000
ElseIf ComboBox1.Text = "DUMAI - BUKITTINGGI" Then
TextBox1.Text = 100000
TextBox2.Text = 150000
TextBox3.Text = 200000
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If RadioButton1.Checked Then
TextBox4.Text = TextBox1.Text
ElseIf RadioButton2.Checked Then
TextBox4.Text = TextBox2.Text
ElseIf RadioButton3.Checked Then
TextBox4.Text = TextBox3.Text
End If
If TextBox5.Text >= 3 Then
TextBox6.Text = TextBox4.Text * 0.1 * TextBox5.Text
ElseIf TextBox5.Text < 3 Then
TextBox6.Text = 0
End If
TextBox7.Text = TextBox4.Text * TextBox5.Text - TextBox6.Text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim x As String
x = MsgBox("ARE YOU SURE ?", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "PO SINAR HARAPAN")
If x = vbNo Then
Else
End
End If
End Sub
End Class
Data Mahasiswa :
Nama : Mhd. Dio ferdian
NPM : 1006724482