Created
August 16, 2014 01:37
-
-
Save brunopgalvao/15ede99687551b998edc to your computer and use it in GitHub Desktop.
When given change how much of each denomination to give back!
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 change_due(input) | |
quarters= (input/25) | |
dimes=((input%25)/10) | |
nickles=(((input%25)%10)/5) | |
pennies=(input%5) | |
puts "#{quarters} quarters, #{dimes} dimes, #{nickles} nickles, and #{pennies} pennies" | |
end | |
change_due(24) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment