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

If Date.Now.DayOfWeek.ToString = "Monday" Then
ElseIf Date.Now.DayOfWeek.ToString = "Tuesday" Then
ElseIf Date.Now.DayOfWeek.ToString = "Wednesday" Then
ElseIf Date.Now.DayOfWeek.ToString = "Thursday" Then
ElseIf Date.Now.DayOfWeek.ToString = "Friday" Then
ElseIf Date.Now.DayOfWeek.ToString = "Saturday" Then
ElseIf Date.Now.DayOfWeek.ToString = "Sunday" Then
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.

and when customer insert the notes into machine, the textbox appear the number of notes.

Insert the notes from where? textbox? or other control?
What the buttons function? you want when the user click the button the textbox show the result of balance? what the itotal function?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.