Question
Make a class BankManager to test the classes Transaction , BankAccount , and Bank . In the main method, do the following: Initialize the static
Make a classBankManagerto test the classesTransaction,BankAccount, andBank. In the main method, do the following:
- Initialize the static data membermonthlyFee, from classBank, to20.0.
- What is an instance of the classBanknamedmyBankusing the constructor with
- two parameters and pass the following two arguments: "LEHIGH UNIVERSITY
- BANK" and "Bethlehem".
- Make aBankAccountobject for each of the following five bank account names
- and balances and add them tomyBankusing methodaddBankAccount().
"John Blake" "Sarah Brown" "Emma Johnson" "Suzan Jones" "Mary Chen" $1,200 $2,045 $450 $23,000 $550
4. Display a main menu with 4 operations for the user to select from:
a.Manage Existing Account: Prompt the user to enter an account number that
is formed of 6 digits and display an error message if the account number is invalid (not 6 digits). Find the account inmyBanklist of accounts. If the account number is not valid or is not found, display a message and prompt the user to enter another operation. If the account number is found, display the following sub menu of operations for the user to select from repeatedly until operation 5 is selected.
1:View Balance- Display the balance of the account.
2:Deposit- Prompt the user for the amount to deposit and a description of the deposit, call methoddeposit()to add the amount to the account balance and display the new balance of the account.
4
CSE17
Lehigh University Fall 2020
3:Withdraw- Prompt the user for the amount to withdraw and a description of the withdrawal and call methodwithdraw(). If the withdrawal is completed successfully (withdraw()returned true), display the new balance, otherwise print an error message.
4:View Statement:- Display complete information of the bank account (owner, account, balance, and list of transactions)
5:Exit Manage Account: the program returns to the bank main menu.
- Add New Account:Prompt the user to enter an owner name and a balance and make an instance of classBankAccount. Add the created instance tomyBankusing methodaddBankAccount().
- Remove Existing Account:Prompt the user to enter an account number that is formed of 6 digits. Find the account in myBank list of accounts. If no bank account is found or the bank account is invalid, display an error message. If the account is found, remove it by calling methodremoveAccount().
- Apply Monthly Fee: Deduct the monthly fee from all the bank accounts using methodwithdrawwith description "Monthly fee".
- View All Accounts: displays the information of all the bank accounts (name, account, and balance only).
- Exit:displays a thank you message and quits the program
Test your program for the different operations using the sample run given below.
Document your code and submit the filesTransaction.java,BankAccount.java,Bank.java, andBankManager.javaon courseSite. Submit the UML diagram of the classesTransaction,BankAccount, andBankand show the relationships between them.
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