Question

In: Computer Science

A bank charges $10 per month plus the following check fees for a commercial checking account:...

A bank charges $10 per month plus the following check fees for a commercial checking account: $.10 each for less than 20 checks $.08 each for 20 - 39 checks $.06 each for 40 - 59 checks $.04 each for 60 or more checks Write a program that prompts the user for the number of checks written each month. Then compute and display the bank’s total service fees for the month. Make sure the output displays with a $ and 2 decimal places. Also, use input validation to handle possible errors in the user input. This program MUST use a decision structure. im using python please help.

Solutions

Expert Solution

total_fees = 0  # variable to store total fees
month = 1  # month counter

# using while to calculate the fees for each month and calculate total fees for each month
while(month <= 12):

   fixed_charges = 10 # initializing fixed charges 
   monthly_fee = fixed_charges    # variable to store monthly fee

   # using a try-except block to validate inputs
   while True:

      # prompt to ask user for numeber of checks written each month
      checks = input('Enter the number of checks wirtten in month {}: '.format(month))

      try:
         checks = int(checks)

      except ValueError:
         print('Valid number, please')
         continue

      if 0 <= checks:
         break
      else:
         print('Please enter a valid number')

   # using if-elif structure to calculate the additional charges and hence total monthly fee
   if checks < 20:
      check_fees = 0.1
      monthly_fee += check_fees * checks

   elif checks >= 20 and checks < 40:
      check_fees = 0.08
      monthly_fee += check_fees * checks
      
   elif checks >= 40 and checks < 60:
      check_fees = 0.06
      monthly_fee += check_fees * checks

   elif checks >= 60:
      check_fees = 0.04
      monthly_fee += check_fees * checks
   
   # increment the month counter
   month += 1

   # add monthly charges to total fees
   total_fees += monthly_fee
   print(monthly_fee)

# display the result
print('Total Bank Charges are: ${}'.format(round(total_fees, 2)))

FOR HELP PLEASE COMMENT.

THANK YOU


Related Solutions

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...
please with java and in JOptionPane if possible .bank charges 10.00 per month plus the following...
please with java and in JOptionPane if possible .bank charges 10.00 per month plus the following fees for a checking account:     .10 each for less 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.00 if the balance of the account falls below $400 (before any check fees are applied). Write a program that...
BOZ abolishes unwarranted bank charges The Bank of Zambia Prohibition Against Unwarranted Bank Charges and Fees...
BOZ abolishes unwarranted bank charges The Bank of Zambia Prohibition Against Unwarranted Bank Charges and Fees of 2018 has now been promulgated into law (Government Gazette number 6693) and Bank of Zambia. This is according to a Circular issued by Deputy Governor-Operations Dr Bwalya Ngandu.However, the Bankers Association of Zambia has warned that the decision to abolish bank charges will only cripple the financial services industry and may result in job losses for some workers in the sector. Association Chief...
Distinguish among the following: a general checking account, an imprest bank account, and a lockbox account.
Distinguish among the following: a general checking account, an imprest bank account, and a lockbox account.
Derek can deposit $283.00 per month for the next 10 years into an account at Bank...
Derek can deposit $283.00 per month for the next 10 years into an account at Bank A. The first deposit will be made next month. Bank A pays 15.00% and compounds interest monthly. Derek can deposit $2,468.00 per year for the next 10 years into an account at Bank B. The first deposit will be made next year. Bank B compounds interest annually. What rate must Bank B pay for Derek to have the same amount in both accounts after...
Derek can deposit $254.00 per month for the next 10 years into an account at Bank...
Derek can deposit $254.00 per month for the next 10 years into an account at Bank A. The first deposit will be made next month. Bank A pays 13.00% and compounds interest monthly. Derek can deposit $2,488.00 per year for the next 10 years into an account at Bank B. The first deposit will be made next year. Bank B compounds interest annually. What rate must Bank B pay for Derek to have the same amount in both accounts after...
Derek can deposit $294.00 per month for the next 10 years into an account at Bank...
Derek can deposit $294.00 per month for the next 10 years into an account at Bank A. The first deposit will be made next month. Bank A pays 12.00% and compounds interest monthly. Derek can deposit $2,445.00 per year for the next 10 years into an account at Bank B. The first deposit will be made next year. Bank B compounds interest annually. What rate must Bank B pay for Derek to have the same amount in both accounts after...
erek can deposit $203.00 per month for the next 10 years into an account at Bank...
erek can deposit $203.00 per month for the next 10 years into an account at Bank A. The first deposit will be made next month. Bank A pays 13.00% and compounds interest monthly. Derek can deposit $2,592.00 per year for the next 10 years into an account at Bank B. The first deposit will be made next year. Bank B compounds interest annually. What rate must Bank B pay for Derek to have the same amount in both accounts after...
Question 2 facts – Joe reconciles his checking account check register to the penny every month...
Question 2 facts – Joe reconciles his checking account check register to the penny every month with the bank’s statement. After accurately recording all of the transactions that he initiated during the month, his check registered showed a balance in his checking account of $1,900 as of the end of the month. When he received his bank statement for the month, he noted for the first time the following as of the end of the month: outstanding checks - $300;...
Westside Energy charges its electric customers a base rate of $4.00 per month, plus 12¢ per...
Westside Energy charges its electric customers a base rate of $4.00 per month, plus 12¢ per kilowatt-hour (kWh) for the first 300 kWh used and 3¢ per kWh for all usage over 300 kWh. Suppose a customer uses x kWh of electricity in one month. (a) Express the monthly cost E as a piecewise defined function of x. (Assume E is measured in dollars.) E(x) = A.  if 0 ≤ x ≤ 300 B.  if 300 < x C. (b) Graph the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT