1 /**
2 A bank customer with a checking and savings account.
3 */
4 public class Customer
5 {
6 private int customerNumber;
7 private BankAccount checkingAccount;
8 private BankAccount savingsAccount;
9
10 /**
11 Constructs a customer with a given number and PIN.
12 @param aCustomerNumber the customer number
13 @param checkingAccountNumber the checking account number
14 @param savingsAccountNumber the savings account number
15 */
16 public Customer(int aCustomerNumber,
17 int checkingAccountNumber, int savingsAccountNumber)
18 {
19 customerNumber = aCustomerNumber;
20 checkingAccount = new BankAccount(checkingAccountNumber);
21 savingsAccount = new BankAccount(savingsAccountNumber);
22 }
23
24 /**
25 Gets the checking account of this customer.
26 @return the checking account
27 */
28 public BankAccount getCheckingAccount()
29 {
30 return checkingAccount;
31 }
32
33 /**
34 Gets the savings account of this customer.
35 @return the savings account
36 */
37 public BankAccount getSavingsAccount()
38 {
39 return savingsAccount;
40 }
41 }