diff --git a/src/Practice.java b/src/Practice.java index c83a376..8592deb 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -17,7 +17,10 @@ public class Practice { * @param items an array of strings to print */ public static void printItems(String[] items) { - // TODO: Implement this method here! + int L = items.length; + for(int i =0; ib){ + return true; + } + else if(c==b){ + return true; + } + else{ + return false; + } } @@ -70,8 +81,22 @@ 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; + int L = words.length; + boolean tf = true; + + for(int i = 0; i < L;i++ ){ + String x = words[i]; + x= x.toLowerCase(); + char c = x.charAt(0); + char a = 'a'; + if(c==a){ + tf = true; + } + else{ + return false; + } + } + return true; } public static void main(String[] args) {