My program is correctly outputting the correct amount of months to repay a given loan amount. Could someone help me with the math part of the solution? I'm trying to use L = $1000, MP = $25, I = 7.2%
Are there a certain amount of months that you're looking to pay it in? As it sits, your code will get here
1 2 3 4
while (M > 0)
MP = (L - I)-(I / 12) - MP;
M = MP / 12;
Since M = 0 when you hit that portion, it will read as false (not true) and continue without going into that code.
Are you wanting to see payments over a series of months, or do you want to just enter a loan amount, interest, and payment and have it paid off in one, two, three, etc... set amount of years. (Is this how the gov see's it? Food? That's a luxury right?)
I may have not been clear in writing my question, but the purpose of my program is suppose to be to enter the loan, interest, and monthly payment amounts and to compute the number of months it will take to repay the loan at the given interest rate and monthly payment.