0

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.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Jx_Man
0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.