C++ 14. Bank Charges A bank charges $10 per month plus the following check fees
ID: 3889704 • Letter: C
Question
C++ 14. Bank Charges A bank charges $10 per month plus the following check fees for a commercial checking account: $.10 each for fewer than 20 checks $.08 each for 20-39 checks $.06 each for 40-59 checks $.04 each for 60 or more checks The bank also charges an extra $15 if the balance of the account falls below $400 (before any check fees are applied). Write a program that asks for the beginning bal- ance and the number of checks written. Compute and display the bank's service fees for the month.Explanation / Answer
PROGRAM CODE:
#include <iostream>
using namespace std;
int main() {
//variables for hokding input data
double balance;
int numberOfChecks;
cout<<"Enter beginning balance: ";
cin>>balance;
//negative scenario
if(balance < 0)
cout<<"The account is overdrawn";
else
{
cout<<" Enter the number of check written: ";
cin>>numberOfChecks;
//when the balance is below 400, deduct $15
if(balance<400)
balance -= 15;
//check fees
if(numberOfChecks<20)
balance -= 10 + numberOfChecks*0.10;
else if(numberOfChecks>=20 && numberOfChecks<=39)
balance -= 10 + numberOfChecks*0.08;
else if(numberOfChecks>=40 && numberOfChecks<=59)
balance -= 10 + numberOfChecks*0.06;
else if(numberOfChecks>=60)
balance -= 10 + numberOfChecks*0.04;
cout<<" The updated balance is $"<<balance<<endl;
}
return 0;
}
OUTPUT:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.