hello and morning
i have a problem in calculate the amount
firstly, i have made a code when user insert the parking ticket into the machine , it will tell the customer to pay certain charge.
like this:
Private Sub btnticket_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnticket.Click
ListBox1.Items.Add(Date.Now.DayOfWeek.ToString)
If Date.Now.DayOfWeek.ToString = "Monday" Then
ListBox1.Items.Add("Charge: 2.00")
ElseIf Date.Now.DayOfWeek.ToString = "Tuesday" Then
ListBox1.Items.Add("Charge: 2.00")
ElseIf Date.Now.DayOfWeek.ToString = "Wednesday" Then
ListBox1.Items.Add("Charge: 2.00")
ElseIf Date.Now.DayOfWeek.ToString = "Thursday" Then
ListBox1.Items.Add("Charge: 2.00")
ElseIf Date.Now.DayOfWeek.ToString = "Friday" Then
ListBox1.Items.Add("Charge: 3.00")
ElseIf Date.Now.DayOfWeek.ToString = "Saturday" Then
ListBox1.Items.Add("Charge: 3.00")
ElseIf Date.Now.DayOfWeek.ToString = "Sunday" Then
ListBox1.Items.Add("Charge: 3.00")
End If
End Sub
and when customer insert the notes into machine, the textbox appear the number of notes.
like this:
Private itotal As Decimal = "0.00"
Private Sub btnseringgit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnseringgit.Click
displaytext.Text = itotal
itotal = itotal + 1
displaytext.Text = Convert.ToString(itotal)
End Sub
Private Sub btnlimaringgit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlimaringgit.Click
displaytext.Text = itotal
itotal = itotal + 5
displaytext.Text = Convert.ToString(itotal)
End Sub
so the problem is the calculate, like when customer insert the notes of five ringgit or one ringgit , how the machine to calculate it?
likes example if customer insert 5 ringgit and the charge is 2 ringgit , the machine need to give back the balance 3 ringgit. or if customer give notes same with the charge, how the machine have to know it.
hope you guys understand the problem .
thank you.