Okay, my instruct gave us this assignment; everything in my program works the way he wants it to, except my error message skips to "how much do you want to deposit?" Does anyone know why?
Write a program which implements a banking system. In your program you should be asking the followings from the user:
A. What type of bank account.
B. Amount of deposit.
C. Duration of deposit.
If bank account is of type 'Checking' an interest rate of 5% per year is given.
If banks account is of type 'Saving' an interest rate of 10% per year is given.
Interest rate are applicable only when the duration equal to or more than one year and deposit amount is more than $ 1,000. For deposit less than one year or for deposit less than $1,000, no interest is paid. You need to calculate the interest amount.
Please make sure you cover all the requirements and test your program for all possible cases. The cases should be:
Checking with deposit for less than a year with deposit greater than 1000.
Checking with deposit for more than a year and deposit greater than 1000.
Saving with deposit for less than a year and deposit amount greater than 1000.
Saving with deposit for more than a year deposit amount greater than 1000.
All above 4 cases with deposit less than 1000.
If the user enters a account type which is not either 'Checking' or 'Saving' exit from the program with an error message.
cout<<"Would you like to open a checking account or a saving account?"<<endl;
cout<<"Enter C for checking or S for saving."<<endl;
cin>>account;
cout<<"How much would you like to deposit?"<<endl;
cin>>ammount;
if (account=='c','C')
interest=ammount*.05;
else if (account=='s','S')
interest=ammount*.1;
else
{
cout<<"Wrong type of account! Try again!"<<endl;
;}
;{
int duration;
cout<<"How many months would you like to open your account for?"<<endl;
cin>>duration
;if (duration>=12&&ammount>=1000)