Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the necessary instance variables. These instance variables should only be accessible inside the Bank class. Its Bank name. The bank name can only contain

Create the necessary instance variables. These instance variables should only be accessible inside the Bank class. Its Bank name. The bank name can only contain alphabetical characters o The letters a to z (upper and lowercase) (zero or many times) o The numbers 0 to 9 (between zero and three times) o The ampersand (&) character (zero or may times) o The space character (zero or one time) o Bank name should be a minimum of 8 characters Its Branch location (one possible value from the enum of BranchLocations) o Please add a minimum of 5 BranchLocations value A collection of all the Accounts created (from the Account class) IF ANY OF THE ABOVE LIMITATIONS / CONDITIONS ARE NOT MET In the constructor o All instance variables should be initialized to a non-null default value that adheres to the limitation and conditions required In the setter method o The instance variable should not be updated. The current value should remain. The Bank class will also include the following, which will be explained later A method to get a specific account by its account number Methods to add an account. o Ensure the account number is unique. This is a requirement for the account to be added the Bank. Methods to view a specific account Methods to modify an account Methods to delete an account Complete the bodies of the class method and the class constructor. DO NOT change any method signature. Default constructor o Leave blank. Constructor with 2 arguments x 2 o Sets the instance variables of the class o Limitations of instance variables must be imposed (stated above) getBankName o retrieves the name of the bank setBankName o returns a Boolean value representing whether the bank name has been updated o only updates the name of the bank if it is valid setBranchLocation x 2 o returns a Boolean value representing whether the bank branch has been updated o only updates the bank branch if it is valid getBranchLocation o returns a string representation of the branch location instance variable getAccountByNumber o searches each account in the bank collection of account. o returns an Account object if the account number is found in the list of Accounts o if the account number is not found, returns an empty object using the default constructor addAccount x 2 o Adds Account to the collections of accounts. o account number must be unique in the Bank to be added to the collections of accounts o If account number is NOT unique in bank collection of accounts, account is not added o returns a Boolean value representing if the account has been added to the list of bank accounts. viewAccount(int) o searches bank collection of accounts and returns the account that matches the specified account number o if the account number is not found, return an empty object using the default constructor viewAccount(byte) o searches bank collection of accounts by index number (starting from zero) o returns the account located at the specified index o If the position is not valid, return an empty object using the default constructor modifyAccount x 6 o ability to change the account name and/or balance. See viewAccount to determine how searching for the account should be done. o Returns a Boolean value representing whether the specified account has been edited. If BOTH account name and account balance are valid values, the Account instance variables should be modified and the boolean value of true should be returned If EITHER account name or account balance have an invalid value, NIETHER Account instance variable should be modified and the boolean value of false should be returned. deleteAccount(int) o Attempts to delete the account by searching the list of accounts by account number Deletes the account if found o returns a boolean value representing if the account has been found & deleted. deleteAccount(byte) o Attempts to delete the account by searching the list of accounts by the index number (starting from zero) Deletes the account if found o returns a Boolean value representing if the account has been found & deleted. Adding additional, inner methods is permitted.

Please help and give me a complete answer. I want to understand so please explain it too.

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

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions