CPP Cafe

The Menu

 

Home -> Menu -> interest

Interest Rate

output

#include <iostream.h>
#include <stdlib.h>
/* figures out interest on a fixed amount after a certain amount of time.
the formula used in this is, I = P * R * T*/

void interest(){
int time;
double interest1;
double rate;
double Principal;

cout<<"Enter the principal amount."<<endl;
cin>>Principal;
cout<<endl;
cout<<"You entered:"<<" "<<Principal<<endl;
cout<<endl;
cout<<"Enter the interest percent rate."<<endl;
cin>>rate;
cout<<"You entered:"<<" "<<rate<<endl;
cout<<endl;
cout<<"Enter how the time in years involved."<<endl;
cin>>time;
cout<<endl;
interest1 = Principal * rate * time;
cout<<"After"<<" "<<time<<" "<<"if you borrowed the"<<" "<<Principal<<" "<<"You would owe this amount $"
<<" "<<interest1<<endl;
cout<<endl;
cout<<"If you loaned someone $"<<" "<<Principal<<" "<<"You would now be due $"<<" "<<interest1<<endl;
cout<<endl;
cout<<"If you owned a"<<" "<<Principal<<" "<<"bond, it would be worth $"<<" "<<interest1<<" "<<"now"<<endl;
}

int main()
{
cout<<"This will see how much interest will make money grow."<<endl;

interest();

system("PAUSE");
return 0;
}