Question: Java project: Create a Package called menu that has the following classes MenuItem The bank will have a menu system composed of menu items. A

Java project:

  • Create a Package called menu that has the following classes
    • MenuItem The bank will have a menu system composed of menu items. A menu item has a protected number and a description as seen in the menu.txt data file. It must have a constructor that will set the data members to values passed in as arguments. We may need to add methods in the future, but for now it must have methods that prints the menu item as number, space, then description. There should be enough space for a two-digit number. For example:

23 cool, coding, for everyone, yay.

  • MenuList This class will hold a public ArrayList of menu items and print the menu. It must have a default no-argument constructor that instantiates an empty list. It must have a constructor that sets the menu list to a MenuItem arraylist passed in as an argument. The print method calls the menu items print methods to create a menu formatted like shown below.

--------------

# Description

-- -----------

0 Exit

1 Balance

2 Deposit

3 Withdraw

4 Transfer

--------------

  • Create a package transactions that has the following classes
    • Transaction The superclass of transactions that you should not be able to instantiate as an object itself. Transactions will hold protected information for specific types of transactions that is inherited in subclasses. The protected data includes the account number, pin, and owner of the account that will be affected by the transaction. It must have only one constructor that uses three arguments to set the number, pin, and owner to passed in values. It must have three methods that will be inherited by subclasses:
      • Retrieves number
      • Retrieves pin
      • Retrieves owner
    • Balance A subclass of Transaction that has a constructor with the three arguments of number, pin, and owner to set the data members.
    • Deposit A subclass of Transaction that has a protected data member for the transaction amount. It will need a constructor that brings in the four values to set the data members. It has one method that retrieves the amount.
    • Withdraw A subclass of Transaction that is set up the same as Deposit except the name, of course.
    • Transfer A subclass of Transaction that has two protected data members of a Withdraw object and a Deposit object because it represents the transfer from one account to another. The constructor will need arguments for the withdrawal account number and pin, the deposit account number and pin, the owner, and amount. Keep in mind that the owner and amount should be the same for both withdrawal and deposit. The super constructor will need to be called so you can use -1 for the arguments. It will need two methods:
      • Retrieve withdraw object
      • Retrieve deposit object
  • Create a package called users that has the following classes
    • User - The superclass of users that you should not be able to instantiate as an object itself. User will hold protected information of the user ID and name (see customers.txt and bankers.txt) that is inherited by subclasses. Names are both first and last name, but you can keep it as a single string with a space between them. It must have a constructor with the two arguments of ID and name which sets the data members. It needs three methods for now:
      • Retrieve the id
      • Retrieve the name
      • Print the account information formatted like shown below:
      • #2837 Micheal Wilmore
    • Banker A subclass of User that, for now, only needs a constructor that sets the bankers ID and name.
    • Customer A subclass of User that, for now, only needs a constructor that sets the customer ID and name.
    • UserList An object that will have ArrayLists for customers and bankers. It must have two constructors:
      • Default no-argument constructor that will instantiate the customer and banker lists
      • Two argument constructor that will set the lists to passed in ArrayLists of customers and bankers

The only method for now should print the customers and banker lists using their print methods. For example:

Customers:

#2837 Micheal Wilmore

#7846 Joe Goldburg

Bankers:

#1827 Gwinaveer Beck

#1689 Peach Georgia

  • Create a package called bank that has the following classes
    • Bank The is the bank object that will hold and process all the information and transactions. It has protected members that include APRList, AccountList, UserList, and MenuList objects. It has one default no-argument constructor that will instantiate these objects.
      • User list - Used the constructor to pass in the array list of customers and bankers from data files. You will need to use the methods to load customers and bankers to generate the array lists. In other words, you will create the list of customers, the list of bankers, then instantiate the object. After loading the user list, call its method to print it.
      • APR list Similarly, it will call the method to load the APR rates from a data file, then instantiate the object using the constructor with an argument. After loading the APR list, call its method to print it.
      • Account list Like the other two, you will call the method to load the accounts from the data file and pass the array list to the constructor. After that, you will also need to call the method to load the owner that will update the account list with the additional owners for the accounts. After loading the additional owners, call its method to print it.
      • Menu list Sameyou will call a method to create the array list of menu items that gets passed to its constructor. After loading the menu list, call its method to print it.

You need the private methods mentioned above:

    • Load menu reads the menu data file and returns the array list of menu item objects
    • Load bankers reads the bankers data file and returns the array list of banker objects
    • Load accounts reads the accounts data file and returns the array list of account objects
    • Load customers reads the customer data file and returns the array list of customer objects
    • Load apr reads the apr data file and returns the array list of APR objets
    • Load owners reads the owners data file and adds owners to the account lists after the accounts list has already been created.
  • Create a package called banking that has the following classes
    • Driver This object will have the main method to instantiate the Bank object. When invoked, it should instantiate the Bank using the constructor that will load the data and print the results.

The results of printing the data using the supplied data files should look like below:

Customers:

#5786 Kobe Bryant

Bankers:

#9283 Lebron James

rate=5.0000 min=$2300000.00

rate=8.0000 min=$209000.00

#19283 owner=[4758, 9483] pin=7483 balance=$37263.57

#30485 owner=[7876, 3578, 9876] pin=2689 balance=$3571.39

--------------

# Description

-- -----------

0 Exit

1 Balance

2 Deposit

3 Withdraw

4 Transfer

--------------

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!