I need to make an auto loan calculator that is only able to calculate 2.3% interest for 84 months. I've never made a calculator that didn't allow a user to input these amounts, so how do I code that part of the calc?
asked Apr 17, 2014 at 13:16 3 1 1 silver badge 4 4 bronze badges it is the same as allowing them to enter the amounts. you just hard-code the values Commented Apr 17, 2014 at 13:34 How would this look in code though? I'm very new to VB. Commented Apr 17, 2014 at 13:45 Dim res As Decimal = 100 ' Current value Dim interest As Decimal = 1.89 / 100 ' 1.89% For i As Integer = 1 To 89 'Months Dim amr As Decimal = res * interest res += amr Next MsgBox(res)
answered Apr 17, 2014 at 13:47
1,536 8 8 silver badges 23 23 bronze badges
Depends on what you want to calculate.. Monthly paiement, equity, what is left to pay ?
Here's the formula to calculate the monthly paiement of a loan
Dim monthlyPaiement As Decimal Dim loanAmount As Decimal Dim interestRate As Decimal Dim loanLengthInMonth As Decimal loanAmount = 25000 interestRate = 1.9 / 100 loanLengthInMonth = 84 interestRate /= 12 ' Divide by number of month in a year monthlyPaiement = loanAmount * ((1 + interestRate) ^ loanLengthInMonth) * interestRate / (((1 + interestRate) ^ loanLengthInMonth) - 1)