Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Invoice(ByRef Name As String, ByVal address As String, ByVal zip As String, ByVal chairs As Double, ByVal sofas As Double)
- Dim Invoice As String, SofaPrice, ChairPrice, Tax As Double
- Dim sr As IO.StreamReader = IO.File.OpenText("PRICE_TAXDATA.TXT")
- Dim fmtstr As String = "{0,-8}|{1,10}"
- Dim basePrice, total As Double
- Invoice = InvoiceNum(Name, zip)
- ChairPrice = CDbl(sr.ReadLine)
- SofaPrice = CDbl(sr.ReadLine)
- Tax = CDbl(sr.ReadLine)
- basePrice = (ChairPrice * chairs) + (SofaPrice * sofas)
- total = (basePrice * Tax) + basePrice
- lstDisplay.Items.Add("Invoice Number: " & InvoiceNum(Name, zip))
- lstDisplay.Items.Add("")
- lstDisplay.Items.Add("Name: " & NameSwitch(Name))
- lstDisplay.Items.Add("Address: " & address)
- lstDisplay.Items.Add("City: " & zip)
- lstDisplay.Items.Add("")
- lstDisplay.Items.Add("Number of chairs: " & chairs)
- lstDisplay.Items.Add("Number of sofas: " & sofas)
- lstDisplay.Items.Add("")
- lstDisplay.Items.Add(fmtstr, "Cost:", basePrice)
- lstDisplay.Items.Add(fmtstr, "Sales Tax:"(basePrice * Tax))
- lstDisplay.Items.Add(fmtstr, " ", "------------")
- lstDisplay.Items.Add(fmtstr, "Total Cost:" & total)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement