MoneyCheckingAccountCheckCheckListDepositDepositListDateBank
CheckList, DepositList, Money, and Date classes. They do not need to be changed. | Money |
| dollars: Integer cents: Integer |
| Date |
|
year: Integer month: Integer day: Integer |
| CheckList |
| checks: Check[] |
| DepositList |
| deposits: Deposit[] |
Check class is not going to be all you need in the long run: How will you represent cash withdrawals, transfers to your savings,
and the like? It is possible to use "Cash" or "Savings" as the payee, and that will do for now. You have seen the Check class
already, and the Deposit class is just a little simpler:
| Check |
| number: Integer date: Date payee: String amount: Money memo: String |
| Deposit |
|
date: Date amount: Money memo: String |
CheckingAccount class. The account must store the account number, balance, a list of checks, a list of deposits,
and the bank or institution where the account is held:
| CheckingAccount |
|
homebank: Bank checks: CheckList deposits: DepositList balance: Money accountnumber: String |
Money class appears three times on my diagram. You might have drawn three lines to it instead: Either is correct.
* on the lines from CheckList to Check and from DepositList to Deposit indicate that any number of Checks can be associated with CheckList and any number of Deposits can be associated with DepositList.