Bank Account Management System: Consider the modified bank account class posted.
ID: 3633646 • Letter: B
Question
Bank Account Management System: Consider the modified bank account class posted. You need to write program that create 5 BankAccount object instances and store them in an array. First program should ask the user to enter account information for each account (see the library program above). Then, your program should provide facilities for the user to manipulate accounts. First it should ask the user to enter the account number. Then, the user should be able to deposit, withdraw, addInterest, and display account summary for the account selected. (Skeleton of the Bank Account Management System program is given). You need to develop a new method that returns the account number. Program should generate the following menu after creating accounts Choose one of the following options 1. Make a deposit. 2. Make a withdrawal. 3. Add interest. 4. Account summary. 5. Exit from this program. Enter the number of your choice: Given: public class AccountManagementSystem { public static void main(String[] args) { int choice=0; boolean done=false; // Create an array to store 5 Bank Acconts // Read account number, name of the owner, initial balance, and in the interest rate // create the account and store them in the array. // Enter the account number you want to manipulate // Find the location of the account in the array do { // Write the code to display the menu shown // Get the choice switch (choice) { // Write cases 1 - 4 case 5: done = true; break; default: System.out.println("Invalid option, try again!"); break; } } while (!done); // Keep going until the user says to stop. } }Explanation / Answer
import java.util.Scanner; class usingLibrary { private String name; private int actNumber; private double balance; public usingLibrary(String userName, int userAccount, double iniBalance) { name = userName; actNumber = userAccount; balance = iniBalance; } public int getActNumber() { return actNumber; } public void withdraw(double withdrawAmount) { if (withdrawAmount 0) balance = balance + depositAmount; else System.out.println("Deposit amount should be positive"); } public double checkBalance() { return balance; } public double chargeFee() { balance = balance - 10; return balance; } } class AccountManagementSystem { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int choice = 0; boolean done = false; // Create an array to store 5 Bank Acconts usingLibrary[] accounts = new usingLibrary[5]; // Read account number, name of the owner, initial balance, and in the // interest rate // create the account and store them in the array. for (int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.