Last active
July 3, 2017 17:34
-
-
Save arieljannai/583359b6f7b4916f1c7a to your computer and use it in GitHub Desktop.
Calculate daily interest
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
// Daily interest calculating. | |
// >> node interest.js days amount interest | |
var args = process.argv.slice(2); | |
var interestDays = function(days, amount, interest) { | |
for (i = 0; i < days; i++) { | |
amount = Number(amount) + ((interest / 100) * amount); | |
} | |
return amount; | |
} | |
console.log('\ntoday payment: ' + interestDays(args[0], args[1], args[2]) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment