From 72526ccbacda14c628ecc85933f1635dd7c32ebe Mon Sep 17 00:00:00 2001 From: tk421 <42457203+tk421bsod@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:05:00 -0700 Subject: [PATCH 1/6] Implement printItems --- src/Practice.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Practice.java b/src/Practice.java index c83a376..39aae41 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -17,7 +17,9 @@ 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); + } } /** From 203a9f8e2cced67522ea67c556881bfd20fea387 Mon Sep 17 00:00:00 2001 From: tk421 <42457203+tk421bsod@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:09:02 -0700 Subject: [PATCH 2/6] Implement moreThanDouble --- src/Practice.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Practice.java b/src/Practice.java index 39aae41..552a3c5 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -46,8 +46,8 @@ 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; + b = b * 2; + return a > b; } From 94f28568c02e3ad020592fe9224a09f73c2cd021 Mon Sep 17 00:00:00 2001 From: tk421 <42457203+tk421bsod@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:11:33 -0700 Subject: [PATCH 3/6] Implement allStartWithA --- src/Practice.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Practice.java b/src/Practice.java index 552a3c5..ed3d249 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -72,8 +72,12 @@ 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; + for (String word : words){ + if (!word.startsWith("a")){ + return false; + } + } + return true; } public static void main(String[] args) { From f3cc74dfe1add54a27dc10492bfe1b52637a2d50 Mon Sep 17 00:00:00 2001 From: tk421 <42457203+tk421bsod@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:12:02 -0700 Subject: [PATCH 4/6] make allStartWithA case-insensitive --- src/Practice.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Practice.java b/src/Practice.java index ed3d249..9f6cdfe 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -73,6 +73,7 @@ public static boolean moreThanDouble(int a, int b) { */ public static boolean allStartWithA(String[] words) { for (String word : words){ + word = word.toLowerCase(); if (!word.startsWith("a")){ return false; } From b74cebd6c70d4d852855fff87c85e3df2cdc7003 Mon Sep 17 00:00:00 2001 From: tk421 <42457203+tk421bsod@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:14:27 -0700 Subject: [PATCH 5/6] Add space before opening braces --- src/Practice.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Practice.java b/src/Practice.java index 9f6cdfe..4680a3f 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -17,7 +17,7 @@ public class Practice { * @param items an array of strings to print */ public static void printItems(String[] items) { - for (String item : items){ + for (String item : items) { System.out.println(item); } } @@ -72,9 +72,9 @@ 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) { - for (String word : words){ + for (String word : words) { word = word.toLowerCase(); - if (!word.startsWith("a")){ + if (!word.startsWith("a")) { return false; } } From b5fd4dded0b4b4dcf0f7b261e655dcad199d4f8c Mon Sep 17 00:00:00 2001 From: tk421 <42457203+tk421bsod@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:16:16 -0700 Subject: [PATCH 6/6] Correct typo in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c26c1eb..e624bcd 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ allStartWithA(new String[]{}): true ``` -Note that getting the correct output does NOT guarantee that your code is fully working. It is your resposibility to work on your code to make sure it works for all cases, not just the sample test cases provided. +Note that getting the correct output does NOT guarantee that your code is fully working. It is your responsibility to work on your code to make sure it works for all cases, not just the sample test cases provided. ## Submitting Make a pull request (PR) against the original repository and submit the URL to your PR on Canvas.