Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Address The Address class describes city and state. It will be used as an aggreg

ID: 3553564 • Letter: A

Question

Address

The Address class describes city and state. It will be used as an aggregate object of the Bank class. It has the following attributes:

Attribute name

Attribute type

Description

City

String

The city where a bank is located

State

String

The state where a bank is located

The following constructor should be provided to initialize each attribute:
    public Address()

This constructor initializes all strings to "?".

The following accessor methods:
   public String getCity()
public String getState()

The following modifier methods:
   public void setCity(String city)
public void setState(String state)

The following method should be provided:
    public String toString()

The toString() method constructs a string of the following form:
Tempe,AZ

The Bank class describes a bank that a customer can open an account. It must have the following attributes:

Attribute name

Attribute type

Description

bankName

String

The bank name

bankID

String

The bank's ID

bankAddress

Address

The address of the bank

The following constructor should be provided to initialize each attribute:
public Bank()
This constructor initializes all strings to "?" and instantiates an address object. .

The following accessor methods should be provided:
public String getBankName()
public String getBankID()
public Address getBankAdress()

The following modifier methods should be provided:
public void setBankName(String bankName)
public void setBankID(String bankID)
public void setBankAddress(String city, String state)

Upon construction the default values for all String attributes should be set to "?".

The following methods must be defined:

public String toString()

The toString() method constructs a string of the following format:

nBank name:ttBank Arizona
Bank ID: 10001
Bank address: tPhoenix,AZ

The BankParser class is a utility class that will be used to create bank objects from a string. The BankParser class cannot be instantiated. It has the following method:

public static Bank bankParser(String lineToParse)

The bankParser method's argument will be a string in the following format:

bankName/bankID/city,state

A real example of this string would be:

Bank Arizona/10001/Phoenix,AZ

The bankParser method will parse this string, pull out the information, create a new bank object, set the attributes of the object, and return it.

The driver program will allow the user to interact with your other classes. The purpose of this application is to handle all user input and screen output. This file is completed for you. Do NOT change it. The main method displays a menu:

Choice tAction
------ ------
A tAdd Bank
B tDisplay Bank
Q tQuit
?ttDisplay Help

Next, the following prompt is displayed:

What action would you like to perform?n

The program reads in the user input and executes the appropriate command. After the execution of each command, redisplays the prompt.

The program displays the following prompt:

Please enter the bank information:n

Reads in the information and parses it using the BankParser class. The bankParser method of the BankParser class returns a Bank object. The Bank object is added to the array that holds all the bank objects.

The program displays the bank information in the following format:

nBank name:ttBank Arizona
Bank ID: 10001
Bank address: tPhoenix,AZ

It uses the toString method of the Bank class to display this information for all accounts.

Quits the program,

The program displays the menu.

If an invalid command is entered, display the following line:

Unknown action

Attribute name

Attribute type

Description

City

String

The city where a bank is located

State

String

The state where a bank is located

Explanation / Answer

Find the code here : http://ideone.com/a8NdKK

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote