Not sure what the error message means

This is an assignment for a class I am taking, and I am having trouble with the error message I am getting. The idea is to have the program perform the following equation:

Amount = Principal * (1 + Rate / T) T

Here is my code: >>Code was removed<<

Here are the errors:
interest.cpp: In function `int main()':
/usr/include/iso/math_iso.h:63: error: too few arguments to function `double pow(double, double)'
interest.cpp:37: error: at this point in file


I just want to clarify that I need help with the errors, and if possible, a hint as to where I need to go because I know that the compiler is having an issue with the pow part of my formula, but I am not sure what it is asking me to correct. I just need a nudge in the right direction.

Cheers,
A
Last edited on
The pow() function takes two doubles, while you are passing two integers. Either use doubles, for your variables, or use casts as in ( double )T.
The compiler error tells that you are passing only one argument to the pow() function.
Change line 37 to amnt = P * pow(1 + rateN/T,T);
You're right, Null! I need better glasses!
Thanks Null and kooth, I got it to run by changing the formula to this:
amnt = P * pow((1 + rateN/T),T);
and declaring my variables accordingly. It now correctly computes and states the amount, as I double checked it with my calculator.
Now I just have to fix my interest formula. Sigh. Thanks to both of you. By the way, I apologize, I went to the documentation section AFTER I posted, (I read the "read this first" after I posted) and saw documentation that helped IMMENSELY. The correct format for my formula should have been:
double pow ( double base, int exponent ); .
That made me look at how I was declaring my vars and I noticed that I had them declared incorrectly too. Thanks again.

PS You two are quick, I wasn't expecting help right away. Means a lot when you are a struggling student.
Last edited on
I'm glad we could help! I started programming long before there was the Internet, and today we have the luxury of having lots of information at our fingertips. This site is one of the best for C++ -- there are lots of great people who are happy to help and this site has a great wealth of information. I still learn something new every time I visit!

Welcome, and great coding!

Kooth
Topic archived. No new replies allowed.