#include <iostream>
#include<cmath>
using namespace std;
class fixeddeposit
{
private:
float p;
int n;
float r;
float A;
public:
void setdata();
void getamount();
};
void fixeddeposit::setdata()
{
cout<<"enter the value of p,n,and r"<<endl;
cin>>p>>n>>r;
}
void fixeddeposit::getamount()
{
A=p*pow((1+r),n);
cout<<"amount is "<<A;
}
int main()
{
fixeddeposit b;
b.setdata();
b.getamount();
}
#include<cmath>
using namespace std;
class fixeddeposit
{
private:
float p;
int n;
float r;
float A;
public:
void setdata();
void getamount();
};
void fixeddeposit::setdata()
{
cout<<"enter the value of p,n,and r"<<endl;
cin>>p>>n>>r;
}
void fixeddeposit::getamount()
{
A=p*pow((1+r),n);
cout<<"amount is "<<A;
}
int main()
{
fixeddeposit b;
b.setdata();
b.getamount();
}
No comments:
Post a Comment