I'm doing the Loan Monthly payment homework. Everything works fine, but the formula just doesn't work, like I don't know what else to do, somewhere I read that we have to divide something by 12, but my teacher didn't mention that so I'm so confused!! Been trying to do it for 3 hours!
Line Number 33 Is Giving Infinite Monthly Payment: $ inf
Correct this and it should work fine. There must never be a case where denominator is "0" otherwise the program will fail unless you handle the exception and correct it.
can u post the code again with all the variable and their names... like what is each of them supposed to be?
and if you know the formula for interest post that too...
i will try to help...
Where,
P = Payment Amount
A = Loan Amount
r = Rate of Interest (compounded)
N = Number of Payments
Rate of Interest Compounded is,
If Monthly, r = i / 1200 and N = n * 12
If Quarterly, r = i / 400 and N = n * 4
If Half yearly, r = i / 200 and N = n * 2
If Yearly, r = i / 100 and N = n