Answer to Question #255093 in Visual Basic for Mea

Question #255093
The system should allow for a customer to check the price of an item from inside the store. Perform a purchase transaction. The system should allow the end user to accept the cash amount and fill in the accepted. Produce a receipt for the customer showing the total cost of items and change given to the customer using a listbox. The receipt must also show the VAT(15%) of items showing a breakdown of the items purchased. The user must just enter a their amount they paying then it must calculate all the information and display on a listbox not textbox. Also it must calculate the information from the selected item which can be multiple items so how would I be able to calculate all items from the list box in one button
1
Expert's answer
2021-10-22T06:50:43-0400
Public Class Form1
    Private amount As Double
    Private total As Double
    Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click


        Dim number As Integer
        Double.TryParse(txtPriceItem.Text, amount)
        Integer.TryParse(txtNumber.Text, number)
        Dim subTotal As Double = number * amount
        Dim VAT As Double = subTotal * 0.15


        total = subTotal + VAT
        txtVAT.Text = VAT.ToString("N2")
        txtTotal.Text = total.ToString("N2")
        btnCalculateChange.Enabled = True
    End Sub


    Private Sub btnCalculateChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculateChange.Click
        Double.TryParse(txtAmount.Text, amount)


        Dim change As Double = amount - total
        txtChange.Text = change.ToString("N2")
    End Sub
End Class




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS