I am new to C++ and worked hours on this today. I need to calculate the future value. Can anyone check this out and see what I am doing wrong? For some reason my pow will not light up so I am not being sure it is being recognized. Any help is greatly appreciated. Thanks!
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
//Payment
cout << " Enter payment amount: ";
double payment;
cin >> payment;
//ENTER INTEREST RATE
cout << " Enter an interest rate: ";
double rate;
cin >> rate;
//ENTER PERIODS
cout << "Enter number of payment periods: ";
double periods;
cin >> periods;
It is compiling fine, but my future value answer is way off. I'm sure it is a equation problem but I do not see what it could be. The exact equation is futurevalue=payment*((1+rate)^periods)-1/periods
should my pow function be pow(periods / 1+ rate) since pow(a,b) computes 'a' raised to the power of 'b?'
cpp(1) : warning C4627: '#include <iostream>': skipped when looking for precompiled header use
Add directive to 'stdafx.h' or rebuild precompiled header
cpp(2) : warning C4627: '#include <cmath>': skipped when looking for precompiled header use
Add directive to 'stdafx.h' or rebuild precompiled header
cpp(31) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?