I am new to c++. I am stuck at this code.
------------------------------------------------------------------------------
# include <iostream>
# include <cmath>
using namespace std;
class FixedDeposit
{
private:
double principle,rate,amount;
int periods;
public:
void setData();
void getAmount();
};
void FixedDeposit::setData()
{
cout << "Enter Amount to be Invested " <<endl;
cin >> principle;
cout << "No of periods in Year " <<endl;
cin >> periods;
cout << "Rate of Interest "<<endl;
cin>> rate;
}
void FixedDeposit::getAmount()
{
amount = principle*((pow(1+(rate/100)),periods));
cout << "You get " <<amount <<endl;
}
int main()
{
FixedDeposit F;
F.setData();
F.getAmount();
}
-----------------------------------------------
Following are errors and warning. Where I am going wrong.Pl Explain
no matching function for call to `pow(double)
candidates are: double pow(double, double)
long double std::pow(long double, int)
float std::pow(float, int)
long double std::pow(long double, long double)