Created
April 26, 2016 21:37
-
-
Save gbrl/e5bf5cac974ff69e3b66cb4a34ffd342 to your computer and use it in GitHub Desktop.
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 calculate(size,num_colours) | |
colour_price = 10 | |
colour_price = 15 if num_colours > 2 | |
total = ((size * 15) + (num_colours * colour_price)) * 1.15 | |
total_in_currency = "%05.2f" % total | |
puts "Your total is $#{total_in_currency}" | |
end | |
# Enter size of sign, and number of colours as parameters | |
calculate(10,3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment