1 import java.util.Scanner;
2
3 /**
4 This program tests the Bank class.
5 */
6 public class BankTester
7 {
8 public static void main(String[] args)
9 {
10 Bank firstBankOfJava = new Bank();
11 firstBankOfJava.addAccount(new BankAccount(1001, 20000));
12 firstBankOfJava.addAccount(new BankAccount(1015, 10000));
13 firstBankOfJava.addAccount(new BankAccount(1729, 15000));
14
15 Scanner in = new Scanner(System.in);
16
17 double threshold = in.nextDouble();
18 int c = firstBankOfJava.count(threshold);
19 System.out.println("Count: " + c);
20 int expectedCount = in.nextInt();
21 System.out.println("Expected: " + expectedCount);
22
23 int accountNumber = in.nextInt();
24 BankAccount a = firstBankOfJava.find(accountNumber);
25 if (a == null)
26 System.out.println("No matching account");
27 else
28 {
29 System.out.println("Balance of matching account: " + a.getBalance());
30 int matchingBalance = in.nextInt();
31 System.out.println("Expected: " + matchingBalance);
32 }
33 }
34 }