see if u can outsmart my stupid book?

Evolution

Veteran XV
ok so... im making a program that calculates loans and shit

basically i dont need help w/ the coding. but in order for my program to ever work, i need to find out the TOTAL INTEREST.

Now the totalInterest is the monthlyInterest from every month summed up.

totalInterest = ???



(It never actually tells me how they got the Total Amount of Interest in the example.)

so knowing this....


The way they got the monthly interest is taking the ammount still owing on the loan and multiply it by the interest rate and then dividing it by the number of months. So the interest is different for every month.
monthlyInterest = (amountRemaing * interestRate) / 12;


but the principal for that months is done by taking the monthlyPayment and subtracting the interest.

monthlyPrincipal = monthlyPayment - monthlyInterest;

NOW HERE'S THE KICKER:
THE WAY THEY FIGURE OUT THE MONTHLY PAYMENT.

monthlyPayment = (loanAmount + totalInterest) / 12;

so as u can see im fucked w/o knowing the totalInterest.

does anyone know a fucking formula for the totalInterest???

i've tried using nested loops, but for some reason i can't get it to add up all the months, something is going wrong.
 
no.... all i want is a fucking formula..... that is all i want

a formula to calculate the total interest.

i mean, there has to be an algebreic formula for it... I can be done once i get this last part into the program....


so i am doing my homework... its all written except it doesn't fuckin work, cuz i can't get the right amount of interest
 
Back
Top