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.
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}")
Comments
Leave a comment