01: /**
02:    A bank customer with a checking and a savings account.
03: */
04: public class Customer
05: {  
06:    /**
07:       Constructs a customer with a given number and PIN.
08:       @param aNumber the customer number
09:       @param aPin the personal identification number
10:    */
11:    public Customer(int aNumber, int aPin)
12:    {  
13:       customerNumber = aNumber;
14:       pin = aPin;
15:       checkingAccount = new BankAccount();
16:       savingsAccount = new BankAccount();
17:    }
18:    
19:    /** 
20:       Tests if this customer matches a customer number 
21:       and PIN.
22:       @param aNumber a customer number
23:       @param aPin a personal identification number
24:       @return true if the customer number and PIN match
25:    */
26:    public boolean match(int aNumber, int aPin)
27:    {  
28:       return customerNumber == aNumber && pin == aPin;
29:    }
30:    
31:    /** 
32:       Gets the checking account of this customer.
33:       @return the checking account
34:    */
35:    public BankAccount getCheckingAccount()
36:    {  
37:       return checkingAccount;
38:    }
39:    
40:    /** 
41:       Gets the savings account of this customer.
42:       @return the checking account
43:    */
44:    public BankAccount getSavingsAccount()
45:    {  
46:       return savingsAccount;
47:    }
48: 
49:    private int customerNumber;
50:    private int pin;
51:    private BankAccount checkingAccount;
52:    private BankAccount savingsAccount;
53: }