Hello. I am an IT major at Arkansas Tech University. I just began programming this semester. I have been given an assignment to give a bank customer certain information about their account and charges. So here is a shortened version of the question:
There are two types of accounts: Checking and Savings. 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%.
B) checking accounts with balances of up to $5,000 more than the minimum balance receive 3% interest; otherwise, the interest is 5%.
Write a program that reads a customer's account number, account type, minimum balance that the account should maintain, and current balance. The program should output the account number, account type, current balance, and an appropriate message.
I know this is not a "do my homework" online community. I have worked on this program and cannot figure out what keeps happening. Any help will be appreciated. Thank you. I am new in this forum, but I guess I just post my code here:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
float minBal, balance, actNum, checking, saving;
char actType;
int main()
{
cout << "What is your account number?" << endl;
cin >> actNum;
cout << endl;
cout << "Is it a checking(C) or savings(S) account?" << endl;
cout << "Press C for checking or S for savings (make sure to capitalize)." << endl;
cin >> actType;
cout << endl;
cout << "What is your minimum balance?" << endl;
cin >> minBal;
cout << endl;
cout << "What is your current balance?" << endl;
cin >> balance;
cout << endl;
checking = 25.00;
saving = 10.00;
if (actType == 'C' || actType == 'c')
{
if (balance < minBal)
{
cout << "You have a service charge of $" << checking;
cout << " for falling below your minimum balance of " << minBal << '.' << endl;
}
{
if (minBal + 5000 <= balance)
{
cout << setw(15) << left << "Account Number" << setfill(' ');
cout << setw(20) << right << "Type" << setfill(' ');
cout << setw(20) << right << "Balance" << setfill (' ');
cout << endl;
cout << setw(15) << left << actNum << setfill (' ');
cout << setw(20) << right << "Checking" << setfill(' ');
cout << setw(20) << right << '$' << balance << setfill(' ');
cout << endl << "Your interest is 3%" << endl << endl;
cout << "Thank you for choosing our bank." << endl;
}
}
}
if (actType == 'S' || actType == 's')
{
if(balance < minBal)
{
cout << "You have a service charge of $" << saving;
cout << " for falling below your minimum balance of $" << minBal;
cout << endl;
}
{
cout << setw(15) << left << "Account Number" << setfill(' ');
cout << setw(20) << right << "Type" << setfill(' ');
cout << setw(20) << right << "Balance" << setfill (' ');
cout << endl;
cout << setw(15) << left << actNum << setfill (' ');
cout << setw(20) << right << "Savings" << setfill(' ');
cout << setw(20) << right << '$' << balance << setfill(' ');
cout << endl << "Your interest if 4%" << endl << endl;
cout << "Thank you for choosing our bank." << endl;
}
}
return 0;
}