|
1 | 1 | package com.codedifferently.lesson17.bank;
|
2 | 2 |
|
3 | 3 | import java.util.Set;
|
4 |
| -import java.util.function.BooleanSupplier; |
5 | 4 |
|
6 |
| -public class SavingsAccount { |
7 |
| - |
8 |
| - public SavingsAccount(String string, Set<Customer> owners, double d) { |
9 |
| - //TODO Auto-generated constructor stub |
10 |
| - } |
11 |
| - |
12 |
| - public Object getAccountNumber() { |
13 |
| - // TODO Auto-generated method stub |
14 |
| - throw new UnsupportedOperationException("Unimplemented method 'getAccountNumber'"); |
| 5 | +public class SavingsAccount extends CheckingAccount { |
| 6 | + public SavingsAccount(String accountNumber, Set <Customer> owners, double initialBalance) { |
| 7 | + super(accountNumber, owners, initialBalance); |
15 | 8 | }
|
16 | 9 |
|
17 |
| - public Object getOwners() { |
18 |
| - // TODO Auto-generated method stub |
19 |
| - throw new UnsupportedOperationException("Unimplemented method 'getOwners'"); |
20 |
| - } |
21 | 10 |
|
22 |
| - public Double getBalance() { |
23 |
| - // TODO Auto-generated method stub |
24 |
| - throw new UnsupportedOperationException("Unimplemented method 'getBalance'"); |
| 11 | +public void writeCheck(double amount) { |
| 12 | + throw new UnsuportedOperationException("Savings account cannot write checks"); |
25 | 13 | }
|
26 |
| - |
27 |
| - public void deposit(double d) { |
28 |
| - // TODO Auto-generated method stub |
29 |
| - throw new UnsupportedOperationException("Unimplemented method 'deposit'"); |
30 |
| - } |
31 |
| - |
32 |
| - public void withdraw(double d) { |
33 |
| - // TODO Auto-generated method stub |
34 |
| - throw new UnsupportedOperationException("Unimplemented method 'withdraw'"); |
35 |
| - } |
36 |
| - |
37 |
| - public Object closeAccount() { |
38 |
| - // TODO Auto-generated method stub |
39 |
| - throw new UnsupportedOperationException("Unimplemented method 'closeAccount'"); |
40 |
| - } |
41 |
| - |
42 |
| - public BooleanSupplier isClosed() { |
43 |
| - // TODO Auto-generated method stub |
44 |
| - throw new UnsupportedOperationException("Unimplemented method 'isClosed'"); |
45 |
| - } |
46 |
| - |
47 | 14 | }
|
0 commit comments