Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/Practice.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public class Practice {
*/
public static void printItems(String[] items) {
// TODO: Implement this method here!
for (int i = 0; i < items.length; i++) {
System.out.println(items[i]);
}
}

/**
Expand Down Expand Up @@ -45,6 +48,9 @@ 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!
if (a > (b * 2)) {
return true;
}
return false;
}

Expand All @@ -71,7 +77,17 @@ 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;
if (words.length == 0) return true;

boolean result = false;
for (String word: words) {
if (word.toLowerCase().startsWith("a")) {
result = true;
} else {
return false;
}
}
return result;
}

public static void main(String[] args) {
Expand Down