Created
May 27, 2014 10:35
-
-
Save Liooo/22a43715abbd6770adf4 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
debt = ARGV[0].to_i | |
pay = ARGV[1].to_i | |
interest_y = 18/100 | |
interest_m = interest_y/12 | |
month=0 | |
while true | |
break if(debt<=0) | |
debt = debt - pay + (debt * interest_m) | |
month += 1 | |
end | |
p month |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment