Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Fundamentals

Authors: Itzik Ben Gan

4th Edition

0138102104, 978-0138102104

More Books

Students also viewed these Databases questions

Question

What is flow?

Answered: 1 week ago

Question

2. What are the different types of networks?

Answered: 1 week ago