Advertisement
veronikaaa86

8. Магазин за детски играчки

Dec 24th, 2021
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. Sub LiveDemo()
  2. Dim tripPrice, countPuzzle, countDolls, countTedyy, countMinions, countTrucks As Double
  3. tripPrice = 40.8
  4. countPuzzle = 20
  5. countDolls = 25
  6. countTedyy = 30
  7. countMinions = 50
  8. countTrucks = 10
  9.  
  10. Dim priceAllToys, countAllToys As Double
  11. priceAllToys = (countPuzzle * 2.6) + (countDolls * 3) + (countTedyy * 4.1) + (countMinions * 8.2) + (countTrucks * 2)
  12. countAllToys = countPuzzle + countDolls + countTedyy + countMinions + countTrucks
  13.  
  14. If countAllToys > 50 Then
  15. priceAllToys = priceAllToys * 0.75
  16. End If
  17.  
  18. priceAllToys = priceAllToys * 0.9
  19.  
  20. If priceAllToys >= tripPrice Then
  21. Debug.Print "Yes! " & (priceAllToys - tripPrice) & " lv left."
  22. Else
  23. Debug.Print "Not enough money! " & (tripPrice - priceAllToys) & " lv needed."
  24. End If
  25. End Sub
  26.  
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement