-
-
Save CheezItMan/a8602e3e6137ca52418057e8252dec1a to your computer and use it in GitHub Desktop.
Js Translation from Ruby snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def coffee_price is_iced, size, flavor_array | |
price = 2.50 | |
if size == 0 | |
elsif size == 1 | |
price += 1 | |
else | |
price *= 2 | |
end | |
if is_iced | |
price += 0.75 | |
end | |
flavor_array.each do |flavor| | |
puts "pumping #{flavor}" | |
price += 0.50 | |
end | |
price | |
end | |
puts coffee_price true, 3, ["vanilla", "lemon"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment