Overview Construct a hierarchy of classes representing savings and checking accounts as well as a means to ‘filter’ account objects. Account Classes Your solution will consist of 4 account classes as described below. It is your responsibility to define the exact relationship among those classes and translate that relationship into source code structure. There is a correct structure; the skeleton must be modified to reflect the correct relationships. Account – represents a general account with basic operations such as deposit, withdraw, etc. Savings – represents a savings account that must maintain a minimum balance. Checking – represents a checking account that has no minimum balance (this means a zero balance). CappedChecking – represents a checking account that disallows a balance above a particular maximum value. Linking Accounts
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Overview
Construct a hierarchy of classes representing savings and checking accounts as well as a means to ‘filter’
account objects.
Account Classes
Your solution will consist of 4 account classes as described below. It is your responsibility to define the
exact relationship among those classes and translate that relationship into source code structure. There is a
correct structure; the skeleton must be modified to reflect the correct relationships.
Account – represents a general account with basic operations such as deposit, withdraw, etc.
Savings – represents a savings account that must maintain a minimum balance.
Checking – represents a checking account that has no minimum balance (this means a zero
balance).
CappedChecking – represents a checking account that disallows a balance above a particular
maximum value.
Linking Accounts
A bank or credit typically allows a user the ability to link accounts together. That is, I might wish to link
my checking account with my savings account. If I overdraw from my savings account, then the appropriate
amount of money is transferred from my savings account into my checking account to prevent against the
overdraw. In this program we wish to simulate this concept with the following requirements:
A checking account may only be linked to a savings account (and vice versa).
An account may only be linked to one other account.
An account may not be linked to itself.
An account may exist without a link to another account.
In this program, we consider a link to be bidirectional; that is, if account A is linked to account B, then B
is only linked to account A. If the user wishes to link account C to A, then the bidirectional link from A to
B must be unlinked before A is then linked to C.
Depositing / Withdrawing Funds and Exceptions
In this program we will use the following rule for deposits: if a deposit operation is unsuccessful a
LinkAccountException will be thrown. For example, if a deposit exceeds the maximum amount
allowed in the account and the account is not linked, an exception will be thrown. If the account is linked,
the remaining monies will be transferred to the linked account.
If a withdrawal operation is unsuccessful an InsufficientFundsException will be thrown. For
example, if a withdrawal exceeds the minimum of an account (and its linked account), an exception shall
be thrown. In the case that a withdrawal results in an account dropping below the minimum, an appropriate
amount of funds shall be transferred from the linked account to the current account in order to attain the
minimum balance.
Filtering
In
project, each account will be labeled as Filterable. That is, you must appropriately define an abstract
In java
![2:54 Sprint
ll 23%
VOLTE
class or interface representing the filterable notion. Each such filterable class must implement the method
boolean accept () which returns true or false based on the following criteria:
A checking account is deemed acceptable if it is linked to an account that is acceptable.
A savings account is deemed acceptable if it maintains at least the minimum amount.
Bank
The Bank class will act as a repository for different accounts, both savings and checking. The class
should be a simple class that:
• Maintains an ArrayList of accounts,
• The ability to add an account (addAccount),
The ability to acquire the filtered list of accounts (getFiltered returns an ArrayList of
Account objects). The filtered set of accounts is based on the accept method.
An accessor method (size) that returns the umber of accounts stored in the Bank.
Testing
A complete test suite has been provided. This includes AccountTester, BankTester, and the
abstract parent class, Tester.
Tester - an abstract class defining several instance variables objects used by each inheriting testing class.
Account Tester - a concrete class that implements all functionality required to test the four account
classes.
BankTester - a concrete class that implements all functionality required to test the Bank class.
The Main class initiates the complete test suite.
Requirements
The program must meet all the requirements as tested from main via the testing classes and described
on the first page of this document.
There are also a few other requirements.
• The minimum amount for a savings account is $100. There is no maximum.
• The minimum amount for a checking account is $0. There is no maximum for a standard
checking account, while capped checking accounts have maximum S10000.
Any method that has an object as a parameter must be checked to verify the object is not null.
Specifications
For clarity, you will implement the following methods in the corresponding classes. You may implement
accessor methods as required.
Class
Methods
Bank
addAccount, getFiltered, size as described above.
link - given an account acct, link this account with acct.
unlink - unlinks this account with acct.
Account
-deposits a given amount of money into the account as described
previously.
II](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff82f27e0-f3df-40ae-98aa-995a5ba8c944%2Fcf74ede8-1f1a-4517-b6b3-2e8a3d7c9ba7%2Fwq9spu6_processed.jpeg&w=3840&q=75)
![withdraw - withdraw a given amount of money from the account as described
previously.
getMinimum - returns the minimum amount of money required by the particular
account.
| Checking
accept - as described previously.
link - given an account acct, link this account with acct.
CappedChecking deposit - deposits a given amount of money into the account as described
previously.
link - given an account acct, link this account with acct.
Recommendations
Review the code that has been provided in the skeleton.
In the corresponding Tester (AccountTester or BankTester), you may opt to comment
out any of the tests in runAll while writing / testing your code.
Test all account code first and perform bank tests second.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff82f27e0-f3df-40ae-98aa-995a5ba8c944%2Fcf74ede8-1f1a-4517-b6b3-2e8a3d7c9ba7%2Fyx6itgn_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)