Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  2. 'Declare base costs/sales tax, as well as all dog types
  3. Dim intNumBeef, intNumPork, intNumTurkey, intNumTotal As Integer
  4. Dim dblSubtotal, dblSalesTax, dblTotalCost As Double
  5. Const DBL_DOG_PRICE As Double = 1.99
  6. Const DBL_SALES_TAX As Double = 0.07
  7.  
  8. 'Declare variables for hotdogs as well as total/subtotal/salestax and cost per dog
  9. intNumBeef = Convert.ToInt32(txtBeefDogs.Text)
  10. intNumPork = Convert.ToInt32(txtPorkDogs.Text)
  11. intNumTurkey = Convert.ToInt32(txtTurkeyDogs.Text)
  12. intNumTotal = intNumBeef + intNumPork + intNumTurkey
  13.  
  14. 'Calculate Subtotal, Sales Tax, and Total Cost
  15. dblSubtotal = intNumTotal * DBL_DOG_PRICE
  16. dblSalesTax = dblSubtotal * DBL_SALES_TAX
  17. dblTotalCost = dblSubtotal + dblSalesTax
  18.  
  19. 'Push SubTotal, SalesTax, and TotalCost to bottom textboxes
  20. txtSubtotal.Text = dblSubtotal.ToString("c2")
  21. txtSalesTax.Text = dblSalesTax.ToString("c2")
  22. txtTotalCost.Text = dblTotalCost.ToString("c2")
  23. End Sub
  24.  
  25. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  26. 'Code for exit
  27. Me.Close()
  28. End Sub
  29. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement