Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. Sub Invoice(ByRef Name As String, ByVal address As String, ByVal zip As String, ByVal chairs As Double, ByVal sofas As Double)
  2. Dim Invoice As String, SofaPrice, ChairPrice, Tax As Double
  3. Dim sr As IO.StreamReader = IO.File.OpenText("PRICE_TAXDATA.TXT")
  4. Dim fmtstr As String = "{0,-8}|{1,10}"
  5. Dim basePrice, total As Double
  6. Invoice = InvoiceNum(Name, zip)
  7. ChairPrice = CDbl(sr.ReadLine)
  8. SofaPrice = CDbl(sr.ReadLine)
  9. Tax = CDbl(sr.ReadLine)
  10. basePrice = (ChairPrice * chairs) + (SofaPrice * sofas)
  11. total = (basePrice * Tax) + basePrice
  12. lstDisplay.Items.Add("Invoice Number: " & InvoiceNum(Name, zip))
  13. lstDisplay.Items.Add("")
  14. lstDisplay.Items.Add("Name: " & NameSwitch(Name))
  15. lstDisplay.Items.Add("Address: " & address)
  16. lstDisplay.Items.Add("City: " & zip)
  17. lstDisplay.Items.Add("")
  18. lstDisplay.Items.Add("Number of chairs: " & chairs)
  19. lstDisplay.Items.Add("Number of sofas: " & sofas)
  20. lstDisplay.Items.Add("")
  21. lstDisplay.Items.Add(fmtstr, "Cost:", basePrice)
  22. lstDisplay.Items.Add(fmtstr, "Sales Tax:"(basePrice * Tax))
  23. lstDisplay.Items.Add(fmtstr, " ", "------------")
  24. lstDisplay.Items.Add(fmtstr, "Total Cost:" & total)
  25. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement