In: Computer Science
The interest rate paid on funds deposited in a bank is determined by the amount of time the money is left on deposit. For a particular bank, the following schedule is used:
Time on Deposit Interested Rate
Greater than or equal to 15 years 16.5 percent
Less than 15 years but greater than or equal to 10 years 11.5 percent
Less than 10 years but greater than or equal to 6 years 7.0 percent
Less than 6 years but greater than or equal to 3 years 3.0 percent
Less than 3 years but greater than or equal to 1 year 1.9 percent
Less than 1 year 1.1 percent
Write a program that accepts the time that funds are left on deposit and displays the interest rate that corresponds to the time entered. use cout and cin as these are the commands we are allowed to use at the moment.
#include <iostream>
using namespace std;
int main() {
int time;
float interest;
cout<<" Time that funds are left on deposit in years
:";
cin>>time;
if(time>=15)
{
interest=16.5;
}else if(time>=10 && time<15)
{
interest=11.5;
}else if(time>=6 && time<10)
{
interest=7.0;
}else if(time>=3 && time<6)
{
interest=3.0;
}else if(time>=1 && time<3)
{
interest=1.9;
}else if(time<1)
{
interest=1.1;
}
cout<<"\nThe Interest rate is
:"<<interest<<"%"<<endl;
}