Question

In c++ format please Bank Charges A bank charges $10 per month plus the following check...

In c++ format please

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 given for the beginning balance, display an urgent message indicating the account is overdrawn.

Sample Output:

Enter the following information about your checking account.
Beginning balance: $500000
Number of checks written: -8
Number of checks must be zero or more.

Enter the following information about your checking account.
Beginning balance: $20000
Number of checks written: 25
The bank fee this month is $12.00

Enter the following information about your checking account.
Beginning balance: $1000
Number of checks written: 5
The bank fee this month is $10.50

Homework Answers

Answer #1

Source Code:

Output:

Code in text format (See above images of code for indentation):

#include<iostream>
#include<iomanip>
using namespace std;

/*main function*/
int main()
{
   /*variables*/
   double balance,fee=10;
   int checks;
   /*read beginning balance*/
   cout<<"Enter the following information about your checking account.\n";
   cout<<"Beginning balance: $";
   cin>>balance;
   /*read number of checks from user*/
   cout<<"Number of checks written: ";
   cin>>checks;
   /*if balance is negative*/
   if(balance<0)
       cout<<"Your account is account is overdrawn!";
   /*if checks are negative*/
   else if(checks<0)
       cout<<"Number of checks must be zero or more.";
   else
   {
       /*if balance is lessthan 400 add extra 15*/
       if(balance<400)
           fee+=15;
       /*check for particular condition and calculate fee*/
       if(checks<20)
           fee+=(checks*0.10);
       else if(checks>=20 && checks<40)
           fee+=(checks*0.08);
       else if(checks>=40 && checks<60)
           fee+=(checks*0.06);
       else
           fee+=(checks*0.04);
       cout<<fixed<<setprecision(2);
       /*print fee*/
       cout<<"The bank fee this month is $"<<fee;
   }
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Randy, a student, has $500 to deposit in a new checking account, but Randy knows he...
Randy, a student, has $500 to deposit in a new checking account, but Randy knows he will not be able to maintain a minimum balance. He will not use an ATM card, but will write a large number of checks. Randy is trying to choose between the unlimited check writing offered by South Trust and the low per-check fee offered by Sun Coast. How many checks would Randy have to write each month for the account at South Trust to...
The John Company maintains a checking account at the Bank of the Cumberland. The bank provides...
The John Company maintains a checking account at the Bank of the Cumberland. The bank provides a bank statement along with canceled checks on the last day of each month. The October 31, 2013, bank statement included the following information: Balance October 1, 2013                             32,690 Deposits                                                       86,000 Checks Processed                                        (75,200) Service Charges                                            (350) NSF Checks                                                 (1,600) Monthly Loan Payment deducted directly by bank from account (includes 400 in interest)                                 (3,400) Balance October 31, 2013                             38,140 The company's general ledger cash (checking) account had a balance of $42,544...
Buick, Inc. maintains a checking account at the Bank of Colorado. The bank provides a bank...
Buick, Inc. maintains a checking account at the Bank of Colorado. The bank provides a bank statement along with canceled checks on the last day of each month. The October 31, 2021, bank statement included the following information: Balance, October 1, 2021 $ 32,690 Deposits 86,000 Checks processed (75,200 ) Service charges (350 ) NSF checks (1,600 ) Monthly loan payment deducted directly by bank from account (includes $400 in interest) (3,400 ) Balance, October 31, 2021 $ 38,140 The...
Brockton Carpet Cleaning prepares a bank reconciliation at the end of every month. At the end...
Brockton Carpet Cleaning prepares a bank reconciliation at the end of every month. At the end of July, the balance in the general ledger checking account was $2,830 and the bank balance on the bank statement was $3,020. Outstanding checks totaled $720 and deposits in transit were $440. The bank statement revealed that a check written for $160 was incorrectly recorded by Brockton as a $260 disbursement. The bank statement listed service charges and NSF check charges totaling $190. The...
The Fitzgerald Company maintains a checking account at the Bank of the North. The bank provides...
The Fitzgerald Company maintains a checking account at the Bank of the North. The bank provides a bank statement along with canceled checks on the last day of each month. The October 31, 2018, bank statement included the following information: Balance, October 1, 2018 $ 32,760 Deposits 89,500 Checks processed (78,700 ) Service charges (420 ) NSF checks (1,670 ) Monthly loan payment deducted directly by bank from account (includes $470 in interest) (4,170 ) Balance, October 31, 2018 $...
The Fitzgerald Company maintains a checking account at the Bank of the North. The bank provides...
The Fitzgerald Company maintains a checking account at the Bank of the North. The bank provides a bank statement along with canceled checks on the last day of each month. The October 31, 2016, bank statement included the following information:   Balance, October 1, 2016 $ 32,760        Deposits 89,500        Checks processed (78,700)       Service charges (420)       NSF checks (1,670)       Monthly loan payment deducted        directly by bank from account        (includes $470 in interest) (4,170)     Balance, October 31, 2016 $ 37,300    The...
1)to determine the best bank for​ Julie.)Selecting a Bank.  Julie wants to open a bank account...
1)to determine the best bank for​ Julie.)Selecting a Bank.  Julie wants to open a bank account with ​$94 Julie estimates that she will write 19 checks per month and use her ATM card at the home bank. She will maintain a monthly balance of​ $600. Which bank should Julie​ choose? ​(Hint​: Use the​ table, to determine the best bank for​ Julie.) Hillsboro Bank First National South Trust Bank Sun Coast Bank ATM​ charges: Home bank Free Free Free Free Other...
Harrison Company maintains a checking account at the First National City Bank. The bank provides a...
Harrison Company maintains a checking account at the First National City Bank. The bank provides a bank statement along with canceled checks on the last day of each month. The July 2021 bank statement included the following information: Balance, July 1, 2021 $ 56,678 Deposits 180,300 Checks processed (193,410 ) Service charges (70 ) NSF checks (1,600 ) Monthly payment on note, deducted directly by bank from account (includes $620 in interest) (3,720 ) Balance, July 31, 2021 $ 38,178...
Item #1. The bank statement for August 2019 shows an ending balance of $3,490. Item #2....
Item #1. The bank statement for August 2019 shows an ending balance of $3,490. Item #2. On August 31 the bank statement shows charges of $35 for the service charge for maintaining the checking account. Item #3. On August 28 the bank statement shows a return item of $100 plus a related bank fee of $10. The return item is a customer's check that was returned because of insufficient funds. Item #4. The bank statement shows a charge of $80...
Harrison Company maintains a checking account at the First National City Bank. The bank provides a...
Harrison Company maintains a checking account at the First National City Bank. The bank provides a bank statement along with canceled checks on the last day of each month. The July 2018 bank statement included the following information: Balance, July 1, 2018 $ 56,428 Deposits 180,100 Checks processed (193,210 ) Service charges (60 ) NSF checks (1,500 ) Monthly loan payment deducted directly by bank from account (includes $520 in interest) (3,620 ) Balance, July 31, 2018 $ 38,138 The...