Hi Everybody I am new to C++ and have a problem from the book my instructor gave that I am having some problems with. I am sure you guys are all familiar with the "mortgage calculator" here is my code. The Errors I am getting are as follows. I have been working on this for a few days now and any help would really be great!!
****************************************************************************************
1>c:\users\thomas family\documents\visual studio 2010\projects\mortgage\mortgage\mort calc.cpp(23): error C2064: term does not evaluate to a function taking 0 arguments
1>c:\users\thomas family\documents\visual studio 2010\projects\mortgage\mortgage\mort calc.cpp(25): error C2064: term does not evaluate to a function taking 4 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
***************************************************************************************
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
void Greeting();
double AskPrinciple();
double AskInterestRate();
double AskYears();
double CalcResults(double Principle, double IR, double Years, double MP);
void WriteResults();
int main()
{
double Principle, Years, MonthlyPayment, TotalInterestPaid, IR, results, MP;
string WriteResults;
Principle = AskPrinciple();
IR = AskInterestRate();
Years = AskYears();
results = WriteResults();
MonthlyPayment = CalcResults ( Principle, IR, Years, MP);
WriteResults (Principle, IR, Years, MP );
return 0;
}
double AskPrinciple()
{
double num;
cout << "\n What is the Principle \n";
cin >> num;
cin.ignore();
return num;
}
double AskInterestRate()
{
double num, finalnum;
cout << "\n What is the Interest Rate? (write in whole number form for example 7.42% is 7.42 not .0742) \n";
cin >> num;
finalnum = num/100;
cin.ignore();
return finalnum;
}
double AskYears()
{
double num;
cout << "\n How Many Years is the Loan? \n";
cin >> num;
cin.ignore();
return num;
}
double calcresults(double Principle, double IR, double Years, double MP)
{
MP = (Principle * IR)/(12*pow(1-((1+(IR/12))),-1*Years*12));
return MP;
}
void Greeting()
{
cout << "\n Welcome to the Mortgage Calculator \n";
}
void WriteResults(double Principle, double IR, double Years, double MP)
{
cout.setf(ios::fixed);
cout.precision(2);
cout<< "\n Your Loan info: \n";
cout<< "Principle: "<< Principle << "\n";
cout<< "Interest Rate is: "<<IR<< "\n";
cout<< "Length of Loan is: "<<Years<<"\n";
cout<< "Monthly Payment is: "<<MP<<"\n";
}