Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub LiveDemo()
- Dim tripPrice, countPuzzle, countDolls, countTedyy, countMinions, countTrucks As Double
- tripPrice = 40.8
- countPuzzle = 20
- countDolls = 25
- countTedyy = 30
- countMinions = 50
- countTrucks = 10
- Dim priceAllToys, countAllToys As Double
- priceAllToys = (countPuzzle * 2.6) + (countDolls * 3) + (countTedyy * 4.1) + (countMinions * 8.2) + (countTrucks * 2)
- countAllToys = countPuzzle + countDolls + countTedyy + countMinions + countTrucks
- If countAllToys > 50 Then
- priceAllToys = priceAllToys * 0.75
- End If
- priceAllToys = priceAllToys * 0.9
- If priceAllToys >= tripPrice Then
- Debug.Print "Yes! " & (priceAllToys - tripPrice) & " lv left."
- Else
- Debug.Print "Not enough money! " & (tripPrice - priceAllToys) & " lv needed."
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement