Hi there im really new to C++ and im supposed to be doing a maturity calculator and i keep getting error code c2661 no overload function takes 1 arguments.

Please look over my code and let me know everything that i have screwed up on because im sure there is a lot :)

 Program for calculating maturity value of a loan.
  */
#include "stdafx.h"
#include <iostream>
#include <math.h>


int _tmain(int argc, _TCHAR* argv[])
{using std::cout;
using std::endl;
using std::cin;
/*
D = Investment Amount 
P = Interest 
Y = Number of Years 
M = Conversions/Year 
S = Maturity Value

Formula for maturity is S = D ( 1 + P/M) to the power of YM
*/
double I,Y,M;
float S,D;
int result;

I=2;
Y=3;
M=4;
D=6;



cout<<"Please enter the total investment amount: ";

cin>>D;

cout<<endl<<"Please enter the interest rate on your investment: ";

cin>>I;

cout<<endl<<"Please enter the length of your investment in years: ";

cin>>Y;

cout<<endl<<"Please enter the number of conversions per year on your investment: ";

cin>>M;


S=pow(M/I)(M*Y); // THIS IS WHERE IM GETTING MY ERROR MESSAGE FROM.

cout<<endl<<"Your total amount of maturity is: ";

S=result+1*D;


cout<<result;


    return 0;
}

Edited 3 Years Ago by mike_2000_17: Fixed formatting

You have a couple of problems in your code.

You should call the pow() like this

S=pow(M/I, M*Y);

result is used uninitialized here

S = result + 1 * D;

Edited 5 Years Ago by gerard4143: n/a

This article has been dead for over six months. Start a new discussion instead.