I'm writing a program that calculates someones consumer loan. If we use $1000 as principle, and 15%(.15) as the rate and the duration of the loan is 18 months, you would in the end only get $775 because the the interest is deducted from the principle leaving you with 775$ from $1000. The user enters their own principle, rate, and time, and the program is suppose to calculate how much to request by adding an extra to the principle. For example: If I want a $1000 loan(15%int. 18 months duration) and the interest is taken out at the time of the loan I would only get $775. I need to come up with a number for them to request to get the $1000 loan they need. So does anyone know of an equation that I could use to calculate any principle, rate, time to come up with the requested loan amount they need to ask for.
The formula for calculating a monthly loan payment is R = Pi/[1 - 1/(1+i)^n] where R = the periodic payment, P = the principal, or debt to be paid off, n = the number of payment periods over which the payments will take place, and i = the periodic interest rate in decimal form. The interest rate for a loan is usually quoted as an annual rate such as 8%. In the formula the first thing we do is convert this to i = .08 when considering annual payments.
If payments are to be made monthly, i = .08/12 = .006666 as the monthly interest rate. An example will illustrate the use of the formula.
Lets say you want to borrow $10,000 for a home improvement, to be paid off monthly over a period of 5 years, with an annual interest rate of 8%. So P = 10,000, n = 5 x 12 = 60, i = .08/12 = .006666. Then we have R = 10000(.006666)/[1 - 1/(1+.006666)^60] = 66.66/[1 - 1/(1.489790] = 66.66/.328764 = $202.76 per month. As simple as that. Over the life of the loan you will pay $12,165.49 back to the bank thereby incurring the cost of $2,165.49 for the priviledge of borrowing the money.