Browse Source

working on account

Jose Bedolla 5 years ago
parent
commit
b2ee25cf1a

+ 8
- 5
src/main/java/rocks/zipcode/quiz5/fundamentals/StringUtils.java View File

@@ -63,11 +63,14 @@ public class StringUtils {
63 63
         return str2;
64 64
     }
65 65
 
66
-    public static String invertCasing(String str) {
67
-
68
-        for (int i = 0; i <str.length() ; i++) {
69
-         //   if (str.charAt(i))
66
+    public static String invertCasing(String text) {
67
+        StringBuilder textSB = new StringBuilder(text);
68
+        for(int i = 0; i < text.length(); i++) {
69
+            if(text.charAt(i) > 64 && text.charAt(i) < 91)
70
+                textSB.setCharAt(i, (char)(text.charAt(i) + 32));
71
+            else if(text.charAt(i) > 96 && text.charAt(i) < 123)
72
+                textSB.setCharAt(i, (char)(text.charAt(i) - 32));
70 73
         }
71
-        return null;
74
+        return textSB.toString();
72 75
     }
73 76
 }

+ 16
- 1
src/main/java/rocks/zipcode/quiz5/objectorientation/account/Account.java View File

@@ -3,11 +3,26 @@ 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
     public Long getId() {
8 8
         return null;
9 9
     }
10 10
 
11 11
     public void setId(Long id) {
12 12
     }
13
+
14
+    @Override
15
+    public void deposit(Double amountToIncreaseBy) {
16
+
17
+    }
18
+
19
+    @Override
20
+    public void withdrawal(Double amountToDecreaseBy) {
21
+
22
+    }
23
+
24
+    @Override
25
+    public Double getBalance() {
26
+        return null;
27
+    }
13 28
 }