From d0f5e9c99e766110116ae8743242b6acd2175346 Mon Sep 17 00:00:00 2001 From: JustinS720 <274596103+JustinS720@users.noreply.github.com> Date: Wed, 8 Apr 2026 12:48:25 -0700 Subject: [PATCH 1/3] Added printItems functionality --- src/Practice.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Practice.java b/src/Practice.java index c83a376..537d11c 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -16,8 +16,12 @@ public class Practice { * * @param items an array of strings to print */ - public static void printItems(String[] items) { - // TODO: Implement this method here! + public static void printItems(String[] items) + { + for (String x : items) + { + System.out.println(x); + } } /** From b25eb565be08e70778f389d4baf52e19b8cc7bb2 Mon Sep 17 00:00:00 2001 From: JustinS720 <274596103+JustinS720@users.noreply.github.com> Date: Wed, 8 Apr 2026 12:51:29 -0700 Subject: [PATCH 2/3] Added moreThanDouble function --- src/Practice.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Practice.java b/src/Practice.java index 537d11c..c2520fd 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -47,9 +47,12 @@ public static void printItems(String[] items) * @param b an int * @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; + public static boolean moreThanDouble(int a, int b) + { + if (a > b * 2) // if b * 2 is less than a, return true! + return true; + else + return false; } From 2d5c7a794269084f1c9f99009830d4770e36859b Mon Sep 17 00:00:00 2001 From: JustinS720 <274596103+JustinS720@users.noreply.github.com> Date: Wed, 8 Apr 2026 13:05:16 -0700 Subject: [PATCH 3/3] Added the allStartWithA function --- src/Practice.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Practice.java b/src/Practice.java index c2520fd..6216771 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -76,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. */ - public static boolean allStartWithA(String[] words) { - // TODO: Delete the dummy return statement and implement this method here! - return false; + public static boolean allStartWithA(String[] words) + { + for (String x : words) + { + String currentWord = x.toLowerCase(); + + for (int i = 0; i < currentWord.length(); i++) + { + if (currentWord.charAt(0) != 'a') + { + return false; + } + } + } + return true; } public static void main(String[] args) {