diff --git a/src/Practice.java b/src/Practice.java index 89acfd9..40855f0 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,11 @@ 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; + boolean tracker = false; + if(a > b*2){ + tracker = true; + } + return tracker; } @@ -69,9 +76,21 @@ public static boolean moreThanDouble(int a, int b) { * @param words a array of words * @return true if every word starts with A (case-insensitive), false otherwise. */ + //javac src/Practice.java && java -cp src Practice public static boolean allStartWithA(String[] words) { // TODO: Delete the dummy return statement and implement this method here! - return false; + boolean checker = false; + // System.out.println(words.length); + int temp = 0; + for (String string : words) { + if (String.valueOf(string.charAt(0)).toLowerCase().equals("a")) { + temp++; + } + } + if (temp == words.length) { + checker = true; + } + return checker; } public static void main(String[] args) {