Build a program that determines monthly payments for a loan. please add problem statement and pseudo code?
Use these parameters: (1)Loan amount as a float (2)Number of months for the loan as an integer (3)Monthly interest rate expressed as a decimal as a float. Please do not pass the annual interest rate and calculate the monthly rate in the function.
The function should return a floating point value that is the monthly payment on the loan using the formula below. It should not output the payment.
P = ___ B * i_____
(1 – (1 + i) -n )
where: P = loan payment, B = balance, i = interest rate, n = number of payments in the loan.
This payment function will need to raise a floating point number to an integer power. Please use this power function
using namespace std ;
float power (int exponent, float number)
if (exponent == 0)
result = power((abs (exponent) - 1), number)* number;
if (exponent >= 1)
return ( 1.0 / result);