A bank charges $10 per month plus: $0.10 each for less than 20 checks $0.08 each
ID: 3644497 • Letter: A
Question
A bank charges $10 per month plus:$0.10 each for less than 20 checks
$0.08 each for 20-39 checks
$0.06 each for 40-59 checks
$0.04 each for 60 or more checks
The bank also charges $15 if the balance falls below $400, before any fees are applied. Do not accept a negative value for the number of checks written.
If a negative value is given for the beginning balance, display a message indicating the account is overdrawn.
Write a program that asks a user to enter the beginning balance of an account and the number of checks written
for month. Calculate the bank charge fee for that month.
Please follow exact input output
Standard Input
401.25
18
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $11.80
Standard Input
1820.43
39
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $13.12
Standard Input
625.00
40
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $12.40
Standard Input
11111.11
60
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $12.40
Standard Input
392.00
1
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $25.10
Standard Input
26.00
20
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $26.60
The account is now overdrawn.
Standard Input
100.00
100
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $29.00
Standard Input
99.99
59
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $28.54
Standard Input
167.34
-3
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The number of checks written must be greater than zero.
Standard Input
200.00
0
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $25.00
Standard Input
0
55
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The bank fee this month is $28.30
The account is now overdrawn.
Standard Input
-2.00
-1
Program Output
Enter the following information about your checking account.
Beginning balance: $
Number of checks written:
The number of checks written must be greater than zero.
The account is now overdrawn.
Explanation / Answer
Please rate...
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
float a,b,c,r;
cout<<" Enter the following information about your checking account. ";
cout<<"Beginning balance: $ ";
cin>>b;
cout<<"Number of checks written: ";
cin>>c;
if(c<0)cout<<"The number of checks written must be greater than zero. ";
else
{
if(c>=0 && c<20)r=0.10*c;
if(c>=20 && c<=39)r=0.08*c;
if(c>=40 && c<=59)r=0.06*c;
if(c>=60)r=0.04*c;
if(b>=0 && b<400)r=r+15;
cout<<"The bank fee this month is $";
cout<<fixed<<setprecision(2)<<r+10<<" ";
}
if(b<=0)cout<<" The account is now overdrawn. ";
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.