Nour
2009-02-01 22:16:13 UTC
// Calculates amount of Investment after Interest Rate.
//
#include
#include
using namespace std;
double futureInvestmentValue(double investmentAmount, double monthlyInterestRate, int years); //prototype//
int main()
{ double investmentAmount;
double monthlyInterestRate;
int years;
cin >> investmentAmount;
cin >> monthlyInterestRate;
cin >> years;
cout << futureInvestmentValue(investmentAmount*pow(1+monthlyInterestRate, years*12);
return 0;
}
double futureInvestmentValue(double investmentAmount, double monthlyInterestRate, int years)
{
futureInvestmentValue= investmentAmount*pow(1+ monthlyInterestRate, years*12);
return futureInvestmentValue;
}
1>c:\users\nour\desktop\things\stuff\assignment 4\assignment 4\assignment 4.cpp(17) : error C2143: syntax error : missing ')' before ';'
1>c:\users\nour\desktop\things\stuff\assignment 4\assignment 4\assignment 4.cpp(17) : error C2660: 'futureInvestmentValue' : function does not take 1 arguments
1>c:\users\nour\desktop\things\stuff\assignment 4\assignment 4\assignment 4.cpp(23) : error C2659: '=' : function as left operand
1>c:\users\nour\desktop\things\stuff\assignment 4\assignment 4\assignment 4.cpp(24) : error C2440: 'return' : cannot convert from 'double (__cdecl *)(double,double,int)' to 'double'