1  // A simple application to show how to use the Account class
  2  //       Nancy McCracken 9/14/97
  3  //
  4  //   AccountTest ----uses---->   Account
  5  //
  6  
  7  public class AccountTest1 
  8  { 
  9    static Account george;    // variable for instance of Account class
 10    
 11    public static void main (String[] args)
 12    {
 13      double interest;
 14  
 15      // create a new instance of the Account class
 16      george = new Account ("George", 5000. );
 17      
 18      System.out.println("George's Bank Account         Balance");
 19      System.out.println("Initial balance is            $" 
 20                   + george.getbalance());
 21  
 22      // call an Account method on the instance george
 23      george.deposit(1500.);
 24      System.out.println("Deposits $1500.               $"
 25                   + george.getbalance());
 26  
 27  
 28      george.withdraw(523.);
 29      System.out.println("Attempt to withdraw $523.     $"
 30                   + george.getbalance());
 31  
 32      interest = george.monthactivity();
 33      System.out.println("After one month, interest $"
 34  	       + interest);
 35      System.out.println("End of the month              $"
 36                   + george.getbalance());
 37    }
 38  }