diff --git a/src/Practice.java b/src/Practice.java index 89acfd9..81383f6 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -17,7 +17,8 @@ public class Practice { * @param items an array of strings to print */ public static void printItems(String[] items) { - // TODO: Implement this method here! + for(String item : items) + System.out.println(item); } /** @@ -44,8 +45,7 @@ public static void printItems(String[] items) { * @return true if a is strictly more than twice the value of b, false otherwise */ public static boolean moreThanDouble(int a, int b) { - // TODO: Delete the dummy return statement and implement this method here! - return false; + return a > 2*b; } @@ -70,8 +70,15 @@ public static boolean moreThanDouble(int a, int b) { * @return true if every word starts with A (case-insensitive), false otherwise. */ public static boolean allStartWithA(String[] words) { - // TODO: Delete the dummy return statement and implement this method here! - return false; + if (words.length ==0) { + return true; + } + for(String word: words) { + if (word==null || word.isEmpty() || !word.toLowerCase().startsWith("a")) { + return false; + } + } + return true; } public static void main(String[] args) {