Question: In Java, design an Account class that will perform capabilities of a single Bank Account, a Bank class that will house multiple accounts and a

In Java, design an Account class that will perform capabilities of a single Bank Account, a Bank class that will house multiple accounts and a BankingApp (with a main method) to simulate a user interface where you can access your accounts and perform banking transactions.

Tasks

Inside of Account Class program the following:

  • 3 instance variables to handle String accountNum, String type, and double balance
  • note the accountNum will be a unique identifier
  • create the Constructor that handles the 3 pieces of instance data in the order mentioned above
  • create the following methods: appropriate accessor methods and behavior methods needed for bank transactions

Inside of the Bank Class complete the following:

  • Create a list called accounts
  • public void showAllAccounts to display all accounts (use an enhanced for loop to iterate over the collection)
  • A method to add a Bank Account
  • A method to get access a particular account by accountNum
  • A method to close a particular account by accountNum

Hint: Think of what a Bank does...it houses many bank accounts...that is why this class is created to "maintain" the collection

Inside of the BankingApp Class program the following:

  • A Bank object called myBank
  • A BankAccount object called account1 with the following properties ("1111","Checking",500.00)
  • A BankAccount object called account2 with the following properties ("2222","Savings",2500.00)
  • Have myBank add the 2 accounts to the collection
  • Set up a user interface to give similar output to the console:
 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!