//******************************************************************** // BankAccounts.java Author: Lewis and Loftus // // Driver to exercise the use of multiple Account objects. //******************************************************************** public class BankAccounts { //----------------------------------------------------------------- // Creates some bank accounts and requests various services. //----------------------------------------------------------------- public static void main (String[] args) { Account acct1 = new Account ("Ted Murphy", 72354, 102.56f); Account acct2 = new Account ("Jane Smith", 69713, 40.00f); Account acct3 = new Account ("Edward Demsey", 93757, 759.32f); acct1.deposit (25.85f); double smithBalance = acct2.deposit (500.00f); System.out.println ("Smith balance after deposit: " + smithBalance); System.out.println ("Smith balance after withdrawal: " + acct2.withdraw (430.75f, 1.50f)); acct3.withdraw (800.00f, 0.0f); // exceeds balance acct1.addInterest(); acct2.addInterest(); acct3.addInterest(); System.out.println (); System.out.println (acct1); System.out.println (acct2); System.out.println (acct3); } }