Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 8 lines (6 sloc) 0.244 kB
534782d @hectorcorrea First commit
authored
1 totalPrice = (price, discountPercent = 0, taxPercent = 10) ->
09216e3 @hectorcorrea switched tabs to spaces
authored
2 discount = (price * (discountPercent/100))
3 tax = (price - discount) * (taxPercent/100)
4 price - discount + tax
534782d @hectorcorrea First commit
authored
5
586dee0 @hectorcorrea minor tweaks
authored
6 total = totalPrice(100, 50)
534782d @hectorcorrea First commit
authored
7 console.log "total price = #{total}"
Something went wrong with that request. Please try again.