if (downpayPercent < 0.20)
{
cout << "Since down payment is less then 20% of home price, the private mortgage insurance will be required at 1% of total loan amount." << endl;
insurancePrice = principalAmount * 0.01;
}
cout << "Do you live in Mecklenburg County? (y or n)" << endl;
cin >> answer1;
cout << "Are you active military? (y or no) "<< endl;
cin >> answer2;
cout << "Are you 65 or older? (y or n)" << endl;
cin >> answer3;
if (debtincomePercentage < 0.28)
{
cout << "Decisioned as approved!" << endl;
cout << "Your debt to income ratio is:" << debtincomePercentage << endl;
}
else
{
cout << "Decision as declined." << endl;
cout << "Your debt to income ratio is:" << debtincomePercentage << endl;
}
if that's the error message you recieved, that is perplexing.
However, a quick paste of your code into my IDE gives me an error on the line immediately following // Calculations compoundTotal = principalAmnt (pow((1+interestRate),loanTerm));
principanAmnt is undefined.
and the line immediately following that you're trying to assign a value to debtincomePercentage, which is defined as const, and thus cannot be modified and gives an error if you try.
I am going out on a limb to say you do not want to make a function but instead you want to do some math operation. In that case you need to change the formatting of this line.