Created
September 21, 2016 11:40
-
-
Save catb0t/8ddb0efd992e7635d7bbe05b59f42d17 to your computer and use it in GitHub Desktop.
carloan
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
double monthlyRate = interestRate / 12f; | |
double finalPrice = ( | |
carPrice * ( | |
monthlyRate * ( | |
Math.pow( (1f + monthlyRate), loanLength) | |
) / ( | |
Math.pow( (1f + monthlyRate), loanLength) - 1f))); //Car loan forumla. | |
finalPrice = Math.floor(finalPrice); //Flooring to make it look nice. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment