Got a warning...like to fix...(I know warning are generally fine...but want to fix)- In bold
20 C:\Documents and Settings\HP_Owner\Desktop\PA2C.cpp [Warning] passing `double' for converting 3 of `double futureInvestmentValue(double, double, int)'
Code:
#include <iostream>
#include <cmath>
using namespace std;
double futureInvestmentValue(double IA, double MIR, int NOY);
int main()
{
double investmentAmount, annualInterestRate, numOfYears, monthlyInterestRate, futureValue;
cout << "Enter investment amount: ";
cin >> investmentAmount;
cout << "Enter monthly interest rate: ";
cin >> annualInterestRate;
cout << "Enter number of years: ";
cin >> numOfYears;
monthlyInterestRate = annualInterestRate / 1200;
futureValue = futureInvestmentValue(investmentAmount,monthlyInterestRate,numOfYears);
cout << "Future value is " << futureValue << endl;
return 0;
}
double futureInvestmentValue(double investmentAmount, double monthlyInterestRate, int numOfYears)
{
double accumulatedValue;
accumulatedValue = investmentAmount * pow(1 + monthlyInterestRate, numOfYears * 12);
return accumulatedValue;
}