Question
Bank Account Class Design The design for a BankAccount object is laid out in the following class diagram: As you might imagine, the deposit_funds(amount) function
Bank Account Class Design The design for a BankAccount object is laid out in the following class diagram: As you might imagine, the deposit_funds(amount) function adds that money to the current balance of the account, and the withdraw_funds(amount) function removes (i.e. subtracts) money from the current balance of the account. Each transaction in the transaction_list is a tuple containing either the word Deposit or the word Withdrawal followed by an amount, for example: ("Deposit", 300.0) or ("Withdrawal", 100.0). The bank accounts in our program do not have an overdraft facility so the user cannot withdraw money they do not have that is, if they had $200 in their account and they tried to withdraw more than $200 then the operation should fail and the withdraw_funds function should raise an Exception with a suitable error message which is caught and displayed in the main.py file where the operation was attempted. All error messages such as those from exceptions should be displayed in a pop-up messagebox. The get_transaction_string method should loop over all the transactions in the transaction_list creating a string version (with newline characters) of all the transactions associated with the account. The save_to_file function should save the account_number, pin_number, balance, and interest_rate in that order to a file called
the design for a bankaccount object is laid out in the following class diagram:
bank account |
account_number : int pin_number : string balance: float interest_rate:float transaction_list:list of two-tuples
|
deposist_funds(amount) withdraw_funds(amount) get_transaaction_string() save_to_file()
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started