In this assignment, we will build a simple simulation of Electronic Funds Transfers (EFT) between bank accounts, incorporating a daily limit. This means that only a certain maximum amount can be withdrawn or transferred from an account per day.
BankAccount
class with a daily limit (5 points)Implement a class BankAccount
with the following properties:
account_number
(str): The account number (e.g., 'NL01BANK0123456789'
or 'BE68BANK12345678'
).balance
(float): Current balance (default 0.0
).daily_limit
(float): The maximum amount a customer can withdraw or transfer per day. Choose a default, for example 1000.0
.amount_withdrawn_today
(float): Keeps track of how much has already been withdrawn today. (Starts at 0.0
.)account_number
, balance
, and optionally daily_limit
as parameters.account_number
starts with “NL” or “BE”. If not, an error message is displayed in the console.deposit(amount: float)
amount
if this amount is greater than 0. Otherwise, it shows an appropriate error message in the console.withdraw(amount: float)
True
if successful, False
if it fails (with a suitable print or message).reset_daily_limit
method:
0.0
.
(In a real situation, this would happen automatically at midnight.)__str__
method: