Hello,
I'm really new to C++ and having difficulties with my mortgage problem,
With my code, I am getting these errors:
c:\users\yin\documents\visual studio 2010\projects\assign3\assign3\assign3.cpp(38): error C2668: 'pow' : ambiguous call to overloaded function
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(583): could be 'long double pow(long double,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(535): or 'float pow(float,int)'
1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(497): or 'double pow(double,int)'
1> while trying to match the argument list '(int, int)'
I can't get the pow to work to solve for "Your monthly payment is" and I'm not sure what I am doing wrong for the last error?
Any help is greatly appreciated!
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
cout << "Welcome! You may request loan payment info for a maximum of 5 loans, up to $999,999, and can terminate by -1\n";
bool finished = false;
int j=1;
while( !finished && j<=5)
{
double answer;
cout << "What is the amount of purchase?" << endl;
cin >> answer;
int payment;
if (answer < 999999)
{
cout << "What is your down payment?" << endl;
cin >> payment;
int i;
if (payment < 999999)
{
cout << "Your interest rate is\n" << endl;
cin >> i;}
else if (payment > 999999)
{
cout << "Choose an amount < 999999" << endl;
}
um. if you are really new to C++ try posting in the begginers section =P
and please put your code in tags so people can read it and help you..
like this:
(code)
code goes here..
(/code)
only instead of using parentheses, use brackets like this [code]
or just use the source code button to the right under format -->