invalid operands of types ‘<unresolved overloaded function type>’ and ‘double’ to binary ‘operator*’
I have no idea what this is saying is wrong with my code....its just a compound interest program that I am writing continuing with getting used to c++ coding.
here is the whole program so far.
Code:
#include<iostream>
using namespace std;
#include<cmath>
int main()
{
double a;
double p;
double r;
double n;
double t;
cout<<"what are you solving for?(amount, principle, rate(decimal), time, number of compounds)(0 if missing)\n"; //prompt for variables//
cin>>a>>p>>r>>t>>n;
if (a==0){
a=p*(1+(r/n));exp(n*t); //formula to find the amount//
cout<<"your amount is $"<<a<<endl;
}
else if(p==0){
p=(a)/((1+r/n))*(exp*(n*t)); //formula to find the principle amount//
cout<<"Your principle is $"<<p<<endl;
}
else if(r==0){
r=n*sqrt((a/p)-1); //finding the interest rate//
cout<<"Your interest rate is "<<r<<"%\n";
}
else if(n==0){
n=(log(a)-log(p))/(log(1+r)); //find the number of compounds//
cout<<"your investment compunded "<<n<<" times.\n";
}
else{
t=((log(a))/(log(1+(r/n))))/n; //finds the missing time//
cout<<"it took "<<t<<" years.\n";
}
return 0;
}