diff --git a/src/Practice.java b/src/Practice.java index 89acfd9..30b62d1 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -18,6 +18,9 @@ public class Practice { */ public static void printItems(String[] items) { // TODO: Implement this method here! + for (String item : items){ + System.out.println(item); + } } /** @@ -45,7 +48,12 @@ public static void printItems(String[] items) { */ public static boolean moreThanDouble(int a, int b) { // TODO: Delete the dummy return statement and implement this method here! - return false; + // if (a > b*2){ + // return true; + // } + // return false; + + return a > b*2; } @@ -71,7 +79,18 @@ public static boolean moreThanDouble(int a, int b) { */ public static boolean allStartWithA(String[] words) { // TODO: Delete the dummy return statement and implement this method here! - return false; + //edge case + if (words.length < 1){ + return false; + } + + for (String word : words){ + String lWord = word.toLowerCase(); + if (lWord.charAt(0) != 'a'){ + return false; + } + } + return true; } public static void main(String[] args) {