I am writing a mortgage calculator for class and am having some problems with the algebra expression and a syntax error at the end. I am posting just he equation so far and the error I get. I belie i am with in the rules please don't hammer if i'm not since this is my first class. there are some extra variables for later use.
#include<iostre am>
#include<cmath>
using std::cout;
using std::endl;
int main()
{
//declare variables
int principal, months, years;
double rate, payment;
//assign values to variables
principal = 100000, xpayment = 84, years = 7, months = 12;
rate = .0535;
//calculations
payment = [principal (1 + rate / 12), pow(0, 360), * (rate / 12)] / [( 1 + rate / 12) - 1];
// output
cout << endl;
<< "monthly payment is " << payment << " dollars";
<< endl;
system("PAUSE") ;
return 0;
}
the errors come up on the calculation line
and <<"monthly payment is " <<payment<< " dollars" line.
#include<iostre am>
#include<cmath>
using std::cout;
using std::endl;
int main()
{
//declare variables
int principal, months, years;
double rate, payment;
//assign values to variables
principal = 100000, xpayment = 84, years = 7, months = 12;
rate = .0535;
//calculations
payment = [principal (1 + rate / 12), pow(0, 360), * (rate / 12)] / [( 1 + rate / 12) - 1];
// output
cout << endl;
<< "monthly payment is " << payment << " dollars";
<< endl;
system("PAUSE") ;
return 0;
}
the errors come up on the calculation line
and <<"monthly payment is " <<payment<< " dollars" line.
Comment