I need this program to do
http://pastebin.com/2Kuf9ekD . The program runs fine, however, when I input the given numbers I get the wrong answer.
For some weird reason my pow isn't highlighted blue, maybe that has to do with it?
#include <math.h>
#include "stdio.h"
#include <iostream>
using namespace std;
int main (void){
//declare variables ---
double investedAmount;
double interest;
double numberofYears;
double conversion;
double maturity;
double m;
double y;
//---------------
cout << "please enter amount saved = " ;
cin >> investedAmount ;
cout << "amount of interest = " ;
cin >> interest;
cout << "number of years: ";
cin >> numberofYears;
cout << "number of conversions per year ";
cin >> conversion;
interest = interest / 100; // divides interest by 100
// Formula for calculating maturity value
m = (1+(interest/conversion));
y = (numberofYears);
maturity = investedAmount*(m*pow(y,m)); ///maturity = investedAmount* (1+(interest/conversion))*pow(numberofYears,conversion)
//--------------------
cout << "Maturity Value " << maturity << endl;
system ("pause"); // break
return 0; // return nothing
}