This is an assignment that i am doing for my class. Everything seem to work right expect for one code which for some reason is not outputting the account type.i am not getting any errors at all.I am input an char type not an number type. just does not seem to output the type of account for some reason
Assignment:
*
A bank updates t customers'' accounts at the end of each month. The bank offers two types of accounts: savings and checking. Every customer must maintain a minimum balance. If a customer's balance falls below the minimum balance, there is a service charge of $10.00 for savings accounts and $25.00 for checking accounts. If the balance at the end of the month is at least the minimum balance, the account receives interest as follows:
a) Savings accounts receive 4% interest.
b) Checking accounts with balances up to $5,000 more than the minimum balance receive 3% interest; otherwise, the interest is 5%.
write a program that reads a customers account number (char; S for savings, C for checking), minimum balance that the account should maintain, and current balance.The program should than output the account number,account type,current balance and interest earned and appropriate message . test your program by running five times , using the following data:
46728 S 1000 2700
87324 C 1500 7689
79873 S 1000 800
89832 C 2000 3000
98322 C 1000 750.
*/
The Code:
#include <iostream>
#include<fstream>
#include<iomanip>
using namespace std;
int main()
{
int accountNum;
char accountType;
char C,S;
float accountBalance;
double interest, minimumBalance;
cout<<"****** WELCOME ******"<<endl;
cout<<"Ready to update customer's accounts? Please Enter the following:"<<endl;
cout<<"Enter Account Number: "<<endl;
cin>> accountNum;
cout<<"Enter Account Type:"<<endl;
cout<<"C = Checking Account"<<endl;
cout<<"S = Saving Account"<<endl;
cin>> accountType;
cout<<"Enter minimum account Balance: "<<endl;
cin>> minimumBalance;
cout<<"Enter the Account Balance: "<<endl;
cin>> accountBalance;
if (accountType == 'S' && accountBalance< minimumBalance)
{
accountBalance= accountBalance - 10.00;
}
if (accountType == 'S' && accountBalance> minimumBalance)
{
interest= (accountBalance * 4)/100;
}
if (accountType== 'C' && accountBalance<minimumBalance )
{
accountBalance= accountBalance - 25.00;
}
if ( accountType == 'C' && accountBalance >= minimumBalance)
{
interest = (accountBalance * 5)/100;
}
if ( accountType= 'C' && accountBalance<= (minimumBalance + 5000.00) && accountBalance > minimumBalance)
{
interest = (accountBalance * 3)/100;
}
cout << fixed << showpoint << setprecision(2);
cout<<"Account Number: "<< accountNum<<endl;
cout<<" Account Type: "<< accountType<<endl;
cout<<"Account Balance: $"<< accountBalance<<endl;/
cout<<"The amount of Interest Earned: $"<< interest<<endl
cin.get();
return 0;
}