Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Sample - 2 _ Bank - Charges _ 2 0 2 3 0 0 - Bank Charges = = = = = = = =
SampleBankCharges
Bank Charges
A bank chares $ per month plus the following check fees for a commercial checking account:
$ each for fewer than checks
$ each for checks
$ each for checks
$ each for or more checks
The bank also charges an extra $ if the balance of the account falls below $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. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn.
def calculateServiceFeesbalance numchecks
if balance
printURGENT: Account is overdrawn!"
return
basefee # Base monthly fee
checkfees # Initialize check fees to
if balance
basefee # Add $ if balance falls below $
if numchecks
checkfees numchecks
elif numchecks and numchecks
checkfees numchecks
elif numchecks and numchecks
checkfees numchecks
else
checkfees numchecks
totalfees basefee checkfees
return totalfees
# Ask for the beginning balance and number of checks written balance floatipput Enter the beginning balance:
numchecks intinputEnter the number of checks written:
# Calculate and display the bank's service fees
servicefees calculateServiceFeesbalence numchccks
printfThe bank's service fees for the month are: $servicefees:f
Page
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started