// // Hints for project 6.7 p.316 // PART I: ======= - Create a class called LLBank with the following: 1- private fields: a constant integer MAX = 30; an array of LLBankCustomer called customers of size MAX an integer count = 0; 2- a constructor that sets up an initially empty bank using an foor loop. public LLBank() { ......... } 3- a method Create() to create a new account. public void create () { System.out.println ("CREATING A NEW CUSTOMER ACCOUNT"); System.out.print ("Account number? "); int acct = Keyboard.readInt (); int index = findAccount(acct); if (index != -1) System.out.println ("Account number already in use."); else { System.out.print ("Name of new customer? "); String name = Keyboard.readString (); System.out.print ("Phone number of new customer? "); String phone = Keyboard.readString (); customers[count] = new LLBankCustomer(acct, name, phone, 0.0); count++; } } 3- a method called deposit() to prompt for deposit information, verify, and process. public void deposit () { System.out.println ("MAKING A DEPOSIT"); System.out.print ("Account number? "); int acct = Keyboard.readInt (); int index = findAccount(acct); if (index == -1) System.out.println ("Invalid account number."); else { System.out.print ("Amount of deposit? "); double amt = Keyboard.readDouble (); if (amt > 0.0) { double update = customers[index].getBalance() + amt; customers[index].setBalance(update); } else System.out.println ("Invalid deposit amount."); } } 4- a method called withdraw to prompt for withdraw information, verify, and process. public void withdraw () { ........ } 5- a method interest() add interest to each existing accounts. public void interest () { System.out.println ("ADDING INTEREST"); for (int idx = 0; idx < count; idx++) customers[idx].setBalance(customers[idx].getBalance() * 1.03); } 6- a toString() that returns the information about the bank as a string. public String toString() { ...... } 7- a method findAccount (long target) that searches for the specified account number. Returns -1 if not found. public int findAccount (long target) { int result = -1, scan=0; boolean found = false; while (scan < count && !found) { if (target == customers[scan].getAccount()) { found = true; result = scan; } scan++; } return result; } } PART II: ======== create a class called LLBankCustomer with the following: 1- private filels: an account of type long 2 Strings for name and phone a double for balance 2- constructor that sets up the customer with the specified information. public LLBankCustomer (long a, String n, String ph, double b) { .............. } 3- a mehod called getAccount() that returns the account number. public long getAccount () { .......... } 4- a method that sets the balance as specified. public void setBalance (double newBalance) { ........... } 5- a method that returns the current balance. public double getBalance () { ........ } 6- toString() that returns this customer's information as a string. public String toString () { .......... } } PART III: ========= 1- Create a driver class LLBankDriver 2- Exercises the methods of an LLBank object. 3- Prompt the with a greetting. 4- instantiate the LLBank class to create an object bank 5- call create() to create an account 6- make a deposit 7- create another account by invoking create(); 8- make a deposit by invoking deposit(); 9- 7- create another account by invoking create(); 10- make a deposit by invoking deposit(); 11- make a withdrawal by invoking withdraw(); 12- print the current status fo the bank object 13- make another withdrawal by invoking withdraw(); 14- add an intrest to the account by invoking interest(); 15- print the final status fo the bank object