-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCustomer.java
More file actions
43 lines (39 loc) · 1.13 KB
/
Copy pathCustomer.java
File metadata and controls
43 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package ch24;
/**
A bank customer with a checking and savings account.
*/
public class Customer
{
private int customerNumber;
private BankAccount checkingAccount;
private BankAccount savingsAccount;
/**
Constructs a customer with a given number and PIN.
@param aCustomerNumber the customer number
@param checkingAccountNumber the checking account number
@param savingsAccountNumber the savings account number
*/
public Customer(int aCustomerNumber,
int checkingAccountNumber, int savingsAccountNumber)
{
customerNumber = aCustomerNumber;
checkingAccount = new BankAccount(checkingAccountNumber);
savingsAccount = new BankAccount(savingsAccountNumber);
}
/**
Gets the checking account of this customer.
@return the checking account
*/
public BankAccount getCheckingAccount()
{
return checkingAccount;
}
/**
Gets the savings account of this customer.
@return the savings account
*/
public BankAccount getSavingsAccount()
{
return savingsAccount;
}
}