Answer to Question #260939 in Python for Ranay Powell

Question #260939

Write a python program that input account holder Id number, account holder name, account number and account balance. A flat monthly maintenance fee of 0.5% is charge on account balance greater than or equal to 5000. The program should use a function to prompt for and input withdrawal amount, also a 2% bank fee is charge on withdrawal amount. Finally calculate the new balance by deducting the withdrawal amount and the bank fee from the balance. Output the account number, previous balance and current balance.

 



1
Expert's answer
2021-11-04T03:50:37-0400
def inputWithdrawal():
    return float(input("Enter withdrawal amount: "))


accountIdNumber=input("Enter account holder Id number: ")
accountName=input("Enter account holder name: ")
accountNumber=input("Enter account number: ")
accountBalance=float(input("Enter account balance: "))


withdrawalAmount=inputWithdrawal()
'''
A flat monthly maintenance fee of 0.5% is charge on account 
balance greater than or equal to 5000.
'''
flatMonthlyMaintenanceFee=0
if accountBalance>=5000:
    flatMonthlyMaintenanceFee=0.005*accountBalance


'''
The program should use a function to prompt for and input withdrawal 
amount, also a 2% bank fee is charge on withdrawal amount. 
'''
bankFee=withdrawalAmount*0.02
'''
Finally calculate the new balance by deducting the withdrawal amount 
and the bank fee from the balance. 
'''
newBalance=accountBalance-withdrawalAmount-flatMonthlyMaintenanceFee-bankFee
'''
Output the account number, previous balance and current balance
'''
print(f"\n\nAccount holder Id number: {accountIdNumber}")
print(f"Account holder name: {accountName}")
print(f"Account holder account number: {accountNumber}")
print(f"Account holder previous account balance: {accountBalance}")
print(f"Account holder current balance: {newBalance}")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog