File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
lesson_17/bank/bank_app/src/main/java/com/codedifferently/lesson17/bank Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
package com .codedifferently .lesson17 .bank ;
2
2
3
- import com .codedifferently .lesson17 .bank .exceptions .AccountNotFoundException ;
4
3
import java .util .HashMap ;
5
4
import java .util .Map ;
6
5
import java .util .Set ;
7
6
import java .util .UUID ;
8
7
8
+ import com .codedifferently .lesson17 .bank .exceptions .AccountNotFoundException ;
9
+
9
10
/** Represents a bank ATM. */
10
11
public class BankAtm {
11
12
@@ -65,10 +66,13 @@ public void depositFunds(String accountNumber, Check check) {
65
66
}
66
67
67
68
/**
68
- * Withdraws funds from an account.
69
+ * Withdraws funds from a specified account.
70
+ *
71
+ * @param accountNumber The unique identifier of the account.
72
+ * @param amount The amount to withdraw from the account.
69
73
*
70
- * @param accountNumber
71
- * @param amount
74
+ * @throws IllegalArgumentException if the account is not found or if the withdrawal
75
+ * would result in a balance below $10,000 for a BusinessCheckingAccount.
72
76
*/
73
77
public void withdrawFunds (String accountNumber , double amount ) {
74
78
CheckingAccount account = getAccountOrThrow (accountNumber );
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public class Check {
17
17
* @param amount The amount of the check.
18
18
* @param account The account the check is drawn on.
19
19
* @throws IllegalArgumentException if the amount is negative or the account is not a
20
- * `CheckingAccount` instance.
20
+ * `CheckingAccount` or `BusinessCheckingAccount` instance.
21
21
*/
22
22
public Check (String checkNumber , double amount , CheckingAccount account ) {
23
23
if ((account instanceof SavingsAccount )) {
You can’t perform that action at this time.
0 commit comments