Question: Write a program named bankefc.java that allows you to set up checking accounts and loan accounts. It should contain 3 classes: Customer, CheckingAccount, LoanAccount. The

Write a program named bankefc.java that allows you to set up checking accounts and loan accounts. It should contain 3 classes: Customer, CheckingAccount, LoanAccount. The CheckingAccount and LoanAccount classes inherit from the Customer class. Create an ArrayList of 5 Checking Account customers and an ArrayList of 5 Loan Account customers. The program should be set up in a loop with the following menu options: (1) Bank Information (show BankBalance, Bank Transactions, Number Customers) (2) Print out all Checking and Savings Account Customer Information (3) Deposit Money (ask user for the Record# and Amount) (4) Withdraw Money (ask user for the Record# and Amount) (5) Make Loan (ask user for the Record# and Amount of Loan) (6) Make Payment (ask user for the Record# and Payment Amount) Extra Credit: Have options to add and delete customers. Format output for currency.Write a program named bankefc.java that allows you to set up checking

accounts and loan accounts. It should contain 3 classes: Customer, CheckingAccount, LoanAccount.

Inheritance The Customer class is the superclass. The CheckingAccount and LoanAccount are the subclasses. They inherit all the properties and methods of the Customer super class by using the extends keyword. For example: class CheckingAccount extends Customer { How to Declare an ArrayList of Objects In your main program, declare two ArrayLists - one for CheckingAccount and one for LoanAccount. You can use the data below to get started. ArrayList Check = new ArrayList(); Check.add(new CheckingAccount("Kirk","David","dkirk@dcccd.edu",10000.0)); Check.add(new CheckingAccount("Kirk","James","tribbles@starfleet.gov",2500.0)); Check.add(new CheckingAccount("Scott","Hulu","hulu@aol.com",2500.0)); ArrayList Loan = new ArrayList(); Loan.add(new LoanAccount("Zeus","Moses","moses@love.com",5000)); Loan.add(new LoanAccount("Einstein","Amy","aeinstein@starfleet.gov",1000)); Loan.add(new LoanAccount("Galileo","Julius","aeinstein@starfleet.gov",500)); Printing all Accounts To print all accounts you can use a for loop to step through each ArrayList element. The following example prints outs the last name of each checking account: for (int x=0; x

System.out.println( Check.get(0).GetBankBalance() ); System.out.println( Loan.get(0).GetBankBalance() );

The CheckingAccount and LoanAccount classes inherit from the Customer class. Create an

if you can code it in textpad and answer that will be awesome.

Customer Class Variable Names protected String EName, IName protected String Email protected int CuscomexTransactions Variable Description Customer's first and last name Customer's e-mail address The total number of transactions (deposits and withdrawals) made by the customer protected static double EankBalance The bank's total balance (static). You should change this variable when customers make deposits, withdrawals, take loans, and make loan payments The bank's total number of transactions (static). Increment this variable every time a customer makes a deposit, withdrawal, takes a loan, or makes a loan protected static int BankTransactions yment protected static int NumberCustomers The total number of customers at the bank (static Methods Names GetFName (SetEName ) GetLName), SetLName() GetEmail (), SetEmail() Methods Description Get and Set methods GetCustomerTransactions () GetBankBalance () GetBankTransactions () GetNumberCustomers () CheckingAccount Class Variable Names private double CheckingBalance private boolean OverdraftHistory Methods Names CheckingAccount (String theLName, String theFName, String theEmail, double OpeningDeposit) Variable Description The customer's checking account balance Set to true if the customer has ever overdrafted Methods Description The constructor should (1) initialize the name and email variables, (2) set CheckingBalance to OpeningDeposit, (3) add the OpeningDeposit to the BankBalance, (4) increment BankTransactions, (5) increment NumherCustomers

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!