Nathan Hall 5 yıl önce
ebeveyn
işleme
73987e9310

+ 1
- 1
src/main/java/rocks/zipcode/quiz5/objectorientation/account/Account.java Dosyayı Görüntüle

@@ -3,7 +3,7 @@ package rocks.zipcode.quiz5.objectorientation.account;
3 3
 /**
4 4
  * @author leon on 30/12/2018.
5 5
  */
6
-public class Account extends BankAccount {
6
+public class Account {
7 7
 
8 8
     private Long id;
9 9
 

+ 3
- 6
src/main/java/rocks/zipcode/quiz5/objectorientation/account/BankAccount.java Dosyayı Görüntüle

@@ -3,7 +3,7 @@ package rocks.zipcode.quiz5.objectorientation.account;
3 3
 /**
4 4
  * @author leon on 27/12/2018.
5 5
  */
6
-public class BankAccount implements Transactable{
6
+public class BankAccount extends Account implements Transactable{
7 7
     private Double val;
8 8
 
9 9
     public Double getVal() {
@@ -15,22 +15,19 @@ public class BankAccount implements Transactable{
15 15
         this.val = val;
16 16
     }
17 17
 
18
+
18 19
     @Override
19 20
     public void deposit(Double amountToIncreaseBy) {
20
-        BankAccount ba = new BankAccount();
21
-        ba.setBalance(ba.getBalance() + amountToIncreaseBy);
21
+
22 22
     }
23 23
 
24 24
     @Override
25 25
     public void withdrawal(Double amountToDecreaseBy) {
26
-        BankAccount ba = new BankAccount();
27
-        ba.setBalance(ba.getBalance() + amountToDecreaseBy);
28 26
 
29 27
     }
30 28
 
31 29
     @Override
32 30
     public Double getBalance() {
33
-
34 31
         return null;
35 32
     }
36 33
 }

+ 21
- 1
src/main/java/rocks/zipcode/quiz5/objectorientation/account/Employee.java Dosyayı Görüntüle

@@ -3,7 +3,7 @@ package rocks.zipcode.quiz5.objectorientation.account;
3 3
 /**
4 4
  * @author leon on 30/12/2018.
5 5
  */
6
-public class Employee implements Transactable {
6
+public class Employee implements Transactable, Worker {
7 7
     private BankAccount bankAccount;
8 8
 
9 9
     public Employee() {
@@ -37,4 +37,24 @@ public class Employee implements Transactable {
37 37
     public Double getBalance() {
38 38
         return null;
39 39
     }
40
+
41
+    @Override
42
+    public void increaseHoursWorked(Double numberOfHours) {
43
+
44
+    }
45
+
46
+    @Override
47
+    public Double getHoursWorked() {
48
+        return null;
49
+    }
50
+
51
+    @Override
52
+    public Double getHourlyWage() {
53
+        return null;
54
+    }
55
+
56
+    @Override
57
+    public Double getMoneyEarned() {
58
+        return null;
59
+    }
40 60
 }