From fbdabfc74de8e6e608634d39459b9b9096503af4 Mon Sep 17 00:00:00 2001 From: Kiyum-06 Date: Tue, 8 Apr 2025 11:22:32 -0700 Subject: [PATCH 1/3] Compketed the first method --- README.md | 6 ++++++ src/Practice.java | 3 +++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 64cab1e..67eeb69 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,21 @@ # java-mini-review + Practice writing Java code and using git/GitHub. Complete the github-intro assignment before this one! ## Setup + Fork and clone this repository. Do not forget to fork before cloning! For a refresher on git/GitHub, see the instructions on the github-intro repository. You will not need to create a `sdev220` directory again, you can re-use the exisiting one you have already made. ## **Commit Frequently!** + To receive full credit **you MUST commit frequently** for this assignment. At the very least, make one commit after completing each method. Make sure to push after each commit! ## Coding + Open this repository using VS Code. Edit the Practice.java file to implement the three methods according to the provided javadoc. ## Running Your Code + To run your code, open a terminal and navigate using `cd` to get to the `java-mini-review` directory (folder). Your terminal should show `java-mini-review` in the path. Execute the below command to run your code: ``` @@ -49,4 +54,5 @@ 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. ## Submitting + Make a pull request (PR) against the original repository and submit the URL to your PR on Canvas. diff --git a/src/Practice.java b/src/Practice.java index 89acfd9..ae0031e 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); + } } /** From 626048d400ee2b05b1a342b7d94b7083821f193d Mon Sep 17 00:00:00 2001 From: Kiyum-06 Date: Tue, 8 Apr 2025 11:36:05 -0700 Subject: [PATCH 2/3] Completed Second Method --- src/Practice.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Practice.java b/src/Practice.java index ae0031e..220fbb5 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -48,7 +48,7 @@ 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; + return a > 2 * b; } From 230bf6eddc899161ac98d47c60e21e6fc962c07a Mon Sep 17 00:00:00 2001 From: Kiyum-06 Date: Tue, 8 Apr 2025 11:38:26 -0700 Subject: [PATCH 3/3] Completed Third Method --- src/Practice.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Practice.java b/src/Practice.java index 220fbb5..32c696a 100644 --- a/src/Practice.java +++ b/src/Practice.java @@ -74,7 +74,12 @@ 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; + for (String word : words) { + if (word.isEmpty() || Character.toLowerCase(word.charAt(0)) != 'a') { + return false; + } + } + return true; } public static void main(String[] args) {