Soujanya Buragapu 5 yıl önce
ebeveyn
işleme
2f2c133b30

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

@@ -3,9 +3,7 @@ package rocks.zipcode.quiz5.collections;
3 3
 import rocks.zipcode.quiz5.objectorientation.Spice;
4 4
 import rocks.zipcode.quiz5.objectorientation.account.BankAccount;
5 5
 
6
-import java.util.ArrayList;
7
-import java.util.List;
8
-import java.util.Map;
6
+import java.util.*;
9 7
 
10 8
 /**
11 9
  * @author leon on 27/12/2018.
@@ -16,13 +14,12 @@ public class Food implements Spice
16 14
     public List<Spice> getAllSpices()
17 15
     {
18 16
         return food;
19
-
20
-        //return (List<Spice>) food.get();
21 17
     }
22 18
 
23 19
     public <SpiceType extends Class<? extends Spice>> Map<SpiceType, Integer> getSpiceCount()
24 20
     {
25
-        return null;
21
+       return null;
22
+
26 23
     }
27 24
 
28 25
     public void applySpice(Spice spice)

+ 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 extends BankAccount implements Transactable
7 7
 {
8 8
     public Long Id;
9 9
     public Account()

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

@@ -11,6 +11,7 @@ public class Employee implements Worker,Transactable
11 11
     public Double HoursWorked;
12 12
     public Double MoneyEarned;
13 13
     public Double HourlyWage;
14
+    public Double amountToDecreaseBy;
14 15
     public Employee()
15 16
     {
16 17
     }
@@ -57,7 +58,9 @@ public class Employee implements Worker,Transactable
57 58
     }
58 59
 
59 60
     @Override
60
-    public void withdrawal(Double amountToDecreaseBy) {
61
+    public void withdrawal(Double amountToDecreaseBy)
62
+    {
63
+        balance -= amountToDecreaseBy;
61 64
 
62 65
     }
63 66