Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

Describe the team dynamics at Facebook.

Answered: 1 week ago