I am trying to create a monthly mortgage calculator in C++, but i cannot get the function I am trying to create to work. The output it gives for the monthly payment is 53125 for a 150000 loan at 4.25%...


I am trying to create a monthly mortgage calculator in C++, but i cannot get the function I am trying to create to work. The output it gives for the monthly payment is 53125 for a 150000 loan at 4.25% for 15 years.


adouble CalcPayment(double P, double mi, double np, double A)<br>{<br>double A1;<br>double A2;<br>double A3;<br>A1 = pow((1 + mi), np);<br>A2 = P * (A1 * mi);<br>powC(1 + mi), np) - 1;<br>A = A2 / A3;<br>%3D<br>A3 =<br>return A;<br>}<br>

Extracted text: adouble CalcPayment(double P, double mi, double np, double A) { double A1; double A2; double A3; A1 = pow((1 + mi), np); A2 = P * (A1 * mi); powC(1 + mi), np) - 1; A = A2 / A3; %3D A3 = return A; }
r(1+r)

Extracted text: r(1+r)" r(1+r)" A = P A = P (1+ r)" – 1 (1+ r)* – 1 where O (Ctrl) - Page 1 e CSIS A = payment Amount per period P= initial Principal (loan amount) r= interest rate per period n= total number of payments or periods Example: What would the monthly payment be on a 15-year, $100,000 loan with a 4.50% annual interest rate? P = $100,000 r= 4.50% per year / 12 months = 0.375% (or 0.00375) per period n = 15 years * 12 months = 180 total periods A = 100,000 * (.00375 * (1 + .00375)180)/((1+.00375)180 – 1)

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here