I am trying to write this formula in C++ syntax. Please see this mortgage calculator page where the formula resides. Thank you.
http://www.netjeff.com/MortgageCalculator/PNI.html
I am trying to write this formula in C++ syntax. Please see this mortgage calculator page where the formula resides. Thank you.
http://www.netjeff.com/MortgageCalculator/PNI.html
convince me its not homework for more help but look up the function pow() from <cmath>
Last edited by Stoned_Coder; 04-04-2003 at 09:13 AM.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
this is for my final project for C++ programming. Appreciate the help anyways.
that wouldn't be too tough.
you'll need about 6 variables.
and the pow function in cmath as Stoned_Coder said will also be needed.
loanamount = loanmopayment * (1 - pow((1 + loanrate), -loanterm)) / loanrate;
not quite. very nearly. you need fix the precedence issue of * and / in your code. I could tell you how but that would spoil your fun!
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
you also need to think about placement of loanamount and loanmopayment. i'm assuming loanmopayment is the monthly payment and loanamount is the principle.