1 /**
2 This program tests the BankAccount class.
3 */
4 public class BankAccountTester
5 {
6 /**
7 Tests the methods of the BankAccount class.
8 @param args not used
9 */
10 public static void main(String[] args)
11 {
12 BankAccount harrysAccount = new BankAccount(1000);
13 harrysAccount.deposit(500); // Balance is now $1500
14 harrysAccount.withdraw(2000); // Balance is now $1490
15 harrysAccount.addInterest(1); // Balance is now $1490 + 14.90
16 System.out.printf("%.2f\n", harrysAccount.getBalance());
17 System.out.println("Expected: 1504.90");
18 }
19 }