// A simple application to show how to use the AccountCmp class // Nancy McCracken 9/14/97 // // AccountTest1 ----uses----> Account // | subclass // AccountCmpTest1 ----uses----> AccountCmp // public class AccountCmpTest1 { static AccountCmp paul; // variable for instance of Account class public static void main(String[] args) { double interest; // create a new instance of the AccountCmp class paul = new AccountCmp ("Paul", 5000. ); System.out.println("Paul's Bank Account Balance"); System.out.println("Initial balance is $" + paul.getbalance()); // call an Account method on the instance paul paul.deposit(1500.); System.out.println("Deposits $1500. $" + paul.getbalance()); paul.withdraw(523.); System.out.println("Attempt to withdraw $523. $" + paul.getbalance()); interest = paul.monthactivity(); System.out.println("After one month, interest $" + interest); System.out.println("End of the month $" + paul.getbalance()); } }