Question: If possible, please dont use . setter in the code. This is javascript and Im using idle. Write a menu driven program with the following
If possible, please dont use setter in the code. This is javascript and Im using idle.
Write a menu driven program with the following options:
Create customer bank account.
Perform account deposit.
Perform account withdraw.
Display account balance.
Display transactions.
Exit
Class Details
The program will include a class, BankAccount, defined in a module called bankaccount.py The Bank account class will contain the following attributes:
Data attributes:
accountnumber: int
accountbalance: float
firstname: str
lastname: str
tranactions: list
Method attributes:
Constructor init that takes the first name, last name, starting balance, and account number as parameters. These parameters will be used to initialize instance variables listed under Data attributes above.
Note: The transactions instance variable should be initialized to a blankempty list
Include getter and setter properties first and last name
deposit: This method takes the deposit amount, updates the account balance and adds a transaction to the list of transactions
withdraw: This method takes the debit amount, updates the account balance, and adds a transaction to the list of transactions.
Note: Withdraw amount cannot be greater than the account balance. Display an error if the account balance is less than the withdraw amount. Do not update the account balance or transactions list.
displaytranactions: This method takes no argument. It displays the transactions: Display each transaction debit or credit on a separate line. Display No transactions if there are no transactions for the account.
displaybalance: This method takes no argument. It displays the current account balance.
displaydetails: The method takes no argument. It displays the account owner first and last name, the account number, and the current account balance.
Main program
The main program will be written in a module named bankaccountclient.py This module will contain code that uses the BankAccount class. The code in this module will present the user with the program options and allow interaction via the menu options. Once the user selects an option, the program will execute logic associated with the option and return to the list of options. Selecting option will allow the program to exit. Students are not required to use functions in this module but are encouraged to add function where they see fit.
Program Menu details:
Create customer bank account: If selected, the program will prompt for the customer first name, last name, account number, and starting balance. The program will use the data entered to create a bank account object and store it in a variable. Once the account is created, the program will display the account details using the bank account display details method.
Note: Do not create the account if any of the following is true: The account number is less than digits, first or last name is blank, balance is less than or an account already exists
Perform deposit: If selected, the program will prompt for the amount to be deposited. The program will use the bank account deposit method to update the account balance and transactions. The updated balance will be displayed.
Note: Deposit amount cannot be negative. Do not run the deposit logic if an account does not exist.
Perform withdraw: The program will prompt the user for the amount to withdraw. The program will use the bank account withdraw method to debit the account balance and update the transactions list. The updated balance will be displayed.
Note: Amount must be positive. Do not run the debit logic if an account does not exist.
Display bank account balance: This option will display the current account balance using the bank account display balance method.
Note: Do not run the display balance logic if an account does not exist.
Display transactions: The program will use the bank account display transactions method to display all transactions for the account.
Note: Do not run the display transactions logic if an account does not exist.
Exit: The program displays a goodbye message and exit
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
