answer using c++ Bank Charges A bank charges $10 per month plus the following ch
ID: 3751345 • Letter: A
Question
answer using c++
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 balance and the number of checks written. Compute and display the bank's service fees for the month. Input Validation: Do not accept a negative value for the number of checks written. If a negative value is siven for the beginning balance, display an urgent message indicating the account is overdrawn.Explanation / Answer
#include <iostream>
using namespace std;
int main()
{
int bal,checks,charges=10;
cout<< "Enter the beginning balance: ";
cin >>bal;
if(bal<0)
{
cout<<"account is overdrawn";
return 0;
}
cout<<"Enter the number of checks:";
cin>>checks;
if(checks<0)
{
cout<<"Plese enter positive value for number of checks";
return 0;
}
if(checks<20)
charges+=10;
else if(checks>=20 && checks<=39)
charges+=8;
else if(checks>=40 && checks<=59)
charges+=06;
else if(checks>=60)
charges+=04;
if(bal<400)
charges+=15;
cout<<charges;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.