0% found this document useful (0 votes)
162 views2 pages

Soal UTS VISUAL BASIC

The document describes a ferry ticket booking system class in VB.NET. It includes methods to populate dropdowns for ferry codes and schedules, set prices based on selections, calculate discounts and totals, process payments, and reset the form. Selecting different ferry codes or schedules will update package name, price, and discount as appropriate. Buttons allow calculating totals, returning payment change, and resetting the form.

Uploaded by

Ferry Nayoan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views2 pages

Soal UTS VISUAL BASIC

The document describes a ferry ticket booking system class in VB.NET. It includes methods to populate dropdowns for ferry codes and schedules, set prices based on selections, calculate discounts and totals, process payments, and reset the form. Selecting different ferry codes or schedules will update package name, price, and discount as appropriate. Buttons allow calculating totals, returning payment change, and resetting the form.

Uploaded by

Ferry Nayoan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Public Class UTSFerry

Private Sub UTSFerry_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
CBKodeFerry.Items.Add("VB01")
CBKodeFerry.Items.Add("VB02")
CBKodeFerry.Items.Add("VB03")

CBHariFerry.Items.Add("Senin - Kamis")
CBHariFerry.Items.Add("Selasa - Jum'at")
CBHariFerry.Items.Add("Rabu - Sabtu")
End Sub

Private Sub CBKodeFerry_SelectedIndexChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CBKodeFerry.SelectedIndexChanged
If CBKodeFerry.Text = "VB01" Then
TBPaketFerry.Text = "VB.06 Fundamental"
ElseIf CBKodeFerry.Text = "VB02" Then
TBPaketFerry.Text = "VB.06 Advance"
ElseIf CBKodeFerry.Text = "VB03" Then
TBPaketFerry.Text = "VB.Net"
End If
End Sub

Private Sub CBHariFerry_SelectedIndexChanged(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
CBHariFerry.SelectedIndexChanged
Select Case CBHariFerry.Text
Case ("Senin - Kamis")
TBPotonganFerry.Text = Val(15 / 100) * Val(TBBiayaFerry.Text)
Case ("Selasa - Jum'at")
TBPotonganFerry.Text = Val(10 / 100) * Val(TBBiayaFerry.Text)
Case ("Rabu - Sabtu")
TBPotonganFerry.Text = Val(5 / 100) * Val(TBBiayaFerry.Text)
End Select
End Sub

Private Sub TBBiayaFerry_TextChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles TBBiayaFerry.TextChanged

End Sub

Private Sub RBPagiFerry_CheckedChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles RBPagiFerry.CheckedChanged
If CBKodeFerry.Text = "VB01" Then
TBBiayaFerry.Text = 350000
ElseIf CBKodeFerry.Text = "VB02" Then
TBBiayaFerry.Text = 500000
ElseIf CBKodeFerry.Text = "VB03" Then
TBBiayaFerry.Text = 750000
End If
End Sub

Private Sub RBSoreFerry_CheckedChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles RBSoreFerry.CheckedChanged
If CBKodeFerry.Text = "VB01" Then
TBBiayaFerry.Text = 400000
ElseIf CBKodeFerry.Text = "VB02" Then
TBBiayaFerry.Text = 550000
ElseIf CBKodeFerry.Text = "VB03" Then
TBBiayaFerry.Text = 800000
End If
End Sub

Private Sub BHitungFerry_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles BHitungFerry.Click
TBTotalFerry.Text = Val(TBBiayaFerry.Text) -
Val(TBPotonganFerry.Text)

TBBayarFerry.Focus()
End Sub

Private Sub BKembaliFerry_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles BKembaliFerry.Click
Me.Close()
End Sub

Private Sub TBBayarFerry_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TBBayarFerry.KeyPress
TBKembaliFerry.Text = Val(TBBayarFerry.Text) - Val(TBTotalFerry.Text)
End Sub

Private Sub BUlangiFerry_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles BUlangiFerry.Click
CBKodeFerry.Text = ""
CBHariFerry.Text = ""
TBPaketFerry.Text = ""
TBPotonganFerry.Text = ""
TBBiayaFerry.Text = ""
TBTotalFerry.Text = ""
TBBayarFerry.Text = ""
TBKembaliFerry.Text = ""
RBPagiFerry.Checked = False
RBSoreFerry.Checked = False

CBKodeFerry.Focus()
End Sub

Private Sub TBPotonganFerry_TextChanged(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles TBPotonganFerry.TextChanged

End Sub
End Class

You might also like