From 6ee49b39418b5314f4167f34386f05b8814d6d9d Mon Sep 17 00:00:00 2001 From: Shuulker Date: Fri, 26 Jan 2024 21:00:24 -0800 Subject: [PATCH 1/2] Completed Java-Lab-002 --- .idea/misc.xml | 2 +- README.md | 11 ++++++++++- src/Date.java | 11 +++++++++++ src/StumpTheChump.java | 13 +++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 src/Date.java diff --git a/.idea/misc.xml b/.idea/misc.xml index cf9abe6..cbbff6a 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/README.md b/README.md index 931badb..b7f9894 100644 --- a/README.md +++ b/README.md @@ -51,4 +51,13 @@ Just as you did in the first lab (Reference the Lab video in your Week 1 module) 4. Then issue a Pull request to my instructor repo 5. **Make sure to COPY the Pull request URL and submit it for the lab/assignment in Canvas.** -Enjoy the learning process! \ No newline at end of file +Enjoy the learning process! + +## Conclusion +Me and my partner played Stump the Chump and in the end the score was 8-9, he won, I was the chump. +We decided to make the game more interesting and open more opportunities for stumping by making a simple array and printing all of the values inside using a for loop. +The first round a kept it simple, I just replaced the L in println with an uppercase I (printIn) but since it makes the typo pop up in red it was pretty easy to catch. +The second round I made things a little more difficult by replacing public class with public main, and he ended up using the compiler to find the issue, so you could say he was a little bit of a chump here. If he made sure to keep closer attention to the syntax used he would've been able to catch the issue. +The third round I replaced the int in the for loop with "var" hoping he wouldn't catch it. It took him some time but he eventually found it. +The fourth round I replaced all of the Ws with double Vs, but it ended up being way more obvious than I thought. +The fifth round I just put a lot of typos in various places. It took him a little time, but he figured it out. \ No newline at end of file diff --git a/src/Date.java b/src/Date.java new file mode 100644 index 0000000..d906eda --- /dev/null +++ b/src/Date.java @@ -0,0 +1,11 @@ +public class Date { + public static void main(String[] args) { + String day = "Friday"; + int date = 26; + String month = "January"; + int year = 2024; + + System.out.println("The date in American Format is " + day + ", " + month + " " + date + ", " + year); + System.out.print("The date in European Format is " + day + ", " + year + " " + month + ", " + date); + } +} diff --git a/src/StumpTheChump.java b/src/StumpTheChump.java index dffc096..38aad2a 100644 --- a/src/StumpTheChump.java +++ b/src/StumpTheChump.java @@ -1,6 +1,19 @@ +import java.util.ArrayList; + public class StumpTheChump { // Initially working program. public static void main(String[] args) { System.out.println("Hi Chump, can you be stumped?"); + System.out.println("These are the chumps..."); + ArrayList chumps = new ArrayList(); + chumps.add("Joseph"); + chumps.add("William"); + chumps.add("Sebastian"); + chumps.add("Ibrahim"); + + for (int i = 0; i < chumps.size(); i++) + System.out.print(chumps.get(i)); + } } + From a3a91a3b8c157b05cec218cba1187e1c5e2483e7 Mon Sep 17 00:00:00 2001 From: Shuulker Date: Fri, 26 Jan 2024 21:03:28 -0800 Subject: [PATCH 2/2] Completed Java-Lab-002 --- src/StumpTheChump.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/StumpTheChump.java b/src/StumpTheChump.java index 38aad2a..1524b54 100644 --- a/src/StumpTheChump.java +++ b/src/StumpTheChump.java @@ -5,14 +5,14 @@ public class StumpTheChump { public static void main(String[] args) { System.out.println("Hi Chump, can you be stumped?"); System.out.println("These are the chumps..."); - ArrayList chumps = new ArrayList(); + ArrayList chumps = new ArrayList<>(); chumps.add("Joseph"); chumps.add("William"); chumps.add("Sebastian"); chumps.add("Ibrahim"); for (int i = 0; i < chumps.size(); i++) - System.out.print(chumps.get(i)); + System.out.println(chumps.get(i)); } }