Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculate a mortage, with terms and interest

Status
Not open for further replies.

snookmann

MIS
Sep 24, 2002
1
US
Iam trying to calculate a mortage for a class project, and I cant get the formula to calculate it right.
I have this so far
//calculate input items:
//Calculate present value (principal)
principal= payment * (interestRate / (1-pow(interestRate + 1,-term)));

//display output items
cout << fixed;
cout.precision(2);
cout <<&quot;Your monthly payments will be $&quot; <<principal << endl;
cout << fixed;
outFile.precision(2);
outFile << &quot;Your monthly payments will be $&quot; << principal << endl;
outFile.close();
return 0
}

Do you see where I have the calculation? What could I be doing wrong. I am trying to input $60,000 at 8% interest for 25 years.To get the correct answer, and it gives me either payments are $0.00, or another ridiculous number
Pleese help me, Iam not soo good at algebra- ic expressions. me the snookmann (Newbie at C++)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top