Question: Sample - 2 _ Bank - Charges _ 2 0 2 3 0 0 - Bank Charges = = = = = = = =

Sample-2_Bank-Charges_2023
00- Bank Charges
==============
A bank chares $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. If a negative value is given for the beginning balance, display an urgent message indicating the account is overdrawn.
def calculateServiceFees(balance, num_checks)
if balance 0
print("URGENT: Account is overdrawn!")
return
base_fee =10 # Base monthly fee
check_fees =0 # Initialize check fees to 0
if balance 400
base_fee =15 # Add $15 if balance falls below $400
if num_checks 20
check_fees = num_checks **0.10
elif num_checks 20 and num_checks 40
check_fees = num_checks **0.08
elif num_checks 40 and num_checks 60
check_fees = num_checks *0.06
else
check_fees = num_checks *0.04
total_fees = base_fee + check_fees
return total_fees
# Ask for the beginning balance and number of checks written balance = float(ipput( Enter the beginning balance: "))
num_checks = int(input("Enter the number of checks written: ))
# Calculate and display the bank's service fees
service_fees = calculateServiceFees(balence, num_chccks)
print(f"The bank's service fees for the month are: ${service_fees:.2f}")
Page 1
 Sample-2_Bank-Charges_2023 00- Bank Charges ============== A bank chares $10 per month

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!