|
@@ -12,13 +12,18 @@ public class BankAccount extends Account implements Transactable {
|
12
|
12
|
|
13
|
13
|
|
14
|
14
|
@Override
|
15
|
|
- public void deposit(Double amountToIncreaseBy) {
|
|
15
|
+ public void deposit(Double amountToIncreaseBy) throws IllegalArgumentException{
|
|
16
|
+ if(amountToIncreaseBy>0)
|
16
|
17
|
valance = valance + amountToIncreaseBy;
|
17
|
18
|
}
|
18
|
19
|
|
19
|
20
|
@Override
|
20
|
|
- public void withdrawal(Double amountToDecreaseBy) {
|
21
|
|
- valance= valance - (amountToDecreaseBy);
|
|
21
|
+ public void withdrawal(Double amountToDecreaseBy)throws IllegalArgumentException {
|
|
22
|
+ // if(valance > amountToDecreaseBy)
|
|
23
|
+ valance = valance - amountToDecreaseBy;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
22
|
27
|
}
|
23
|
28
|
|
24
|
29
|
@Override
|