#include<iostream>
using namespace std;
int main()
{
int y,a,m,t2,i1,t1,i2;
float r=10.50/100,r2=11.50/100;
cout<<"Interest method: ";
cin>>m;
if (m==1)
{
cout<<"Loan amount: ";
cin>>a;
cout<<"Number of year :";
cin>>y;
i1=a*r*y;
t1=a+i1;
cout<<"Interest amount"<<i1<<endl;
cout<<"Total amount"<<t1<<endl;
}
else if(m==2)
{
cout<<"Loan amount: ";
cin>>a;
cout<<"Number of year :";
cin>>y;
i2=t2-a;
t2=a*r2*y;
cout<<"Total amount :"<<t2<<endl;
cout<<"Interest amount :"<<i2<<endl;
}
else
{
cout<<"Invalid interest metod!";
}
return 0;
}
using namespace std;
int main()
{
int y,a,m,t2,i1,t1,i2;
float r=10.50/100,r2=11.50/100;
cout<<"Interest method: ";
cin>>m;
if (m==1)
{
cout<<"Loan amount: ";
cin>>a;
cout<<"Number of year :";
cin>>y;
i1=a*r*y;
t1=a+i1;
cout<<"Interest amount"<<i1<<endl;
cout<<"Total amount"<<t1<<endl;
}
else if(m==2)
{
cout<<"Loan amount: ";
cin>>a;
cout<<"Number of year :";
cin>>y;
i2=t2-a;
t2=a*r2*y;
cout<<"Total amount :"<<t2<<endl;
cout<<"Interest amount :"<<i2<<endl;
}
else
{
cout<<"Invalid interest metod!";
}
return 0;
}
No comments :
Post a Comment