Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. Public Class Case3
  2. Dim QtyComputer, QtySpeaker, QtyKeyboard, Total As Integer
  3. Dim strComputer, strSpeaker, strKeyboard As String
  4.  
  5. Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
  6. Select Case cmbProduct.Text
  7. Case "Computer"
  8. QtyComputer += txtQuantity.Text
  9. strComputer = QtyComputer.ToString()
  10. txtSaved.Text += cmbProduct.Text + ", " + strComputer
  11. Case "Speaker"
  12. QtySpeaker = txtQuantity.Text
  13. strSpeaker = QtySpeaker.ToString()
  14. txtSaved.Text += cmbProduct.Text + ", " + strSpeaker
  15. Case "Keyboard"
  16. QtyKeyboard = txtQuantity.Text
  17. strKeyboard = QtyKeyboard.ToString()
  18. txtSaved.Text += cmbProduct.Text + ", " + strKeyboard
  19. End Select
  20. End Sub
  21.  
  22. Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
  23. Total = (QtyComputer * lblComputerPrice.Text) + (QtyKeyboard * lblKeyboardPrice.Text) + (QtySpeaker * lblSpeakerPrice.Text)
  24. If QtyComputer > 2 Then
  25. txtTotal.Text = Total * 90 / 100
  26. Else
  27. txtTotal.Text = Total
  28. End If
  29.  
  30. End Sub
  31. End Class
  32.  
  33. Buat case 3 tadi ya
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement