Lab Assignment 5
CS202, Summer 2004
1.(10pt) 11.23(c)
- Again, read the text from a file.
- You don't have to do any sorting.
- First use HashMap, and then replace it with TreeMap
and see whether there's any difference in output.
3.(10pt) Write two exception classes, AccountDepositException
and AccountWithdrawException, and modify the Account class such that
- deposit() throws AccountDepositException when the
amount
to be deposit is negative
- withdraw() throws AccountWithdrawException when
the amount to be
withdrawn is negative or greater than the balance
- transfer() handles both deposit and withdraw failures
properly
(taking advantage of exception handling, of course).