#include <iostream>
#include <cmath>
usingnamespace std;
//Declaration of Functions
double percentToNormal(double percent);
int main()
{
double a;
int principle;
double percentRate;
double rate;
int numberOfDays;
cout << "How much money did you start with? " << endl;
cin >> principle >> endl;
cout << "How much money do you expect to make? " << endl;
cin >> percentRate >> endl;
cout << "How many days would you like to keep your money? " << endl;
cin >> numberOfDays >> endl;
rate = percentToNormal(percentRate);
for(int day=1;day<=numberOfDays; day++){
a = principle * pow(1+rate, day);
cout << day << " --------- " << a << endl;
}
return 0;
}
// Custom Functions
double percentToNormal(double percent)
{
double rate;
rate = (percent/100);
return rate;
}
Hey Guys I'm new to the forum. I'm getting this error: no match for operator >> in std::cin, on line 20 (cin >> principle >> endl;). I think it applies for all cins. What am I doing wrong?