Created
May 23, 2019 02:41
-
-
Save StickmanNinja/087ea76c1a4ffcce96fb64d54ec61117 to your computer and use it in GitHub Desktop.
Just a short script.
This file contains hidden or 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
<html> | |
<body> | |
<script> | |
var originmortgage = (6073 / 12); | |
var origininterest = (0.03 / 12); | |
var downpayment = 20000; | |
var totalcost = 100000; | |
var unpaidbalance = (totalcost - downpayment); | |
function getWoke(mortgage, interest) { | |
console.log(unpaidbalance); | |
var i; | |
for (i = 0; i < 13; i++) { | |
var realinterest = unpaidbalance * interest; | |
console.log(realinterest); | |
var unpaidbalancereduction = mortgage - realinterest; | |
var unpaidbalance = totalcost - downpayment - unpaidbalancereduction; | |
if (i == 12) { | |
alert(totalcost - unpaidbalance); | |
} | |
console.log(totalcost - unpaidbalance); | |
} | |
}; | |
getWoke(originmortgage, origininterest); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment