/** The purpose of this file Driver.java is to test the * methods of the Account class. Let's open some accounts * and play with people's money. */ public class Driver { public static void main(String [] args) { // Use constructors to create new accounts. Account bob = new Account(500.00); Account jill = new Account(); Account ruth = new Account(bob); // Perform routine transactions. bob.withdraw(100.00); jill.deposit(150.00); bob.accrueInterest(); ruth.accrueInterest(); jill.writeCheck(50.00); bob.transfer(jill, 100.00); // Output new balances. System.out.printf("Bob's account has %s\n", bob.toString()); System.out.printf("Jill's account has %s\n", jill.toString()); System.out.printf("Ruth's account has %s\n", ruth.toString()); } } /////////////////////////////// // The output is: // Check #101 has cleared. // Bob's account has $ 312.00 // Jill's account has $ 200.00 // Ruth's account has $ 515.00 ///////////////////////////////