From 656027f182842d55d55850e86281a48a9334172f Mon Sep 17 00:00:00 2001 From: crucial707 Date: Thu, 25 Jan 2024 15:25:01 -0800 Subject: [PATCH 1/2] Lab 02 Austin Barnett --- .idea/misc.xml | 2 +- README.md | 13 ++++++++++++- src/StumpTheChump.java | 14 +++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) 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..6d0c0b4 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,18 @@ HINT: CR Computer Science Discord groups are a great way to play this game remot **After 5 rounds, modify this README.md with a paragraph describing your attempt to stump your partner and the steps your partner took to identify and correct the error or the steps you think they should have used if they didn't solve the problem.** ---- +-- +I played Stump The Chump with a friend of mine from High School that was a Computer Science Major at University of Utah. +I had a feeling he was going to be WAYYY better than me at this game, and I was right. I used one of the simple +programs I wrote from exercises in the lecture notes. I tried to stump him by changing println to printin, +but he caught those without even compiling. He tried to change the name of the main class on me, which I also caught +without compiling. The next round I deleted some ;, he had to compile that time. He got me as well by deleting one of +} at the end. He changed System.out.println to System.in.println, I caught that. He deleted the static in public static +void and I didn't catch that without compiling. I deleted one of the scanners in the scanner Scanner line, which he +caught easily as well. The main thing that I noticed in looking for errors without compiling was paying attention to the +hints that intelliJ gives you, and to be meticulous. Also, if I want to win, probably don't play with someone who codes +for a living. He doesn't do Java professionally, but nevertheless, he whooped me. + ## Part 2: Date Display Program diff --git a/src/StumpTheChump.java b/src/StumpTheChump.java index dffc096..82722db 100644 --- a/src/StumpTheChump.java +++ b/src/StumpTheChump.java @@ -1,6 +1,18 @@ +import java.util.Scanner; public class StumpTheChump { // Initially working program. public static void main(String[] args) { - System.out.println("Hi Chump, can you be stumped?"); + Scanner scanner = new Scanner(System.in); + System.out.println("I will tell you a story, but first I need some Info"); + System.out.println("What is your Name?"); + String first = scanner.nextLine(); + System.out.println("What is your Job?"); + String second = scanner.nextLine(); + + + System.out.println("Here is the story: Once upon a time there was " + first + " who was a " + second); + System.out.println("On the way to work, " + first + " refelcted on AI"); + System.out.println(" Perhaps, " + first + " Will not be a " + second + " forever..."); } } + From 5b24bf72ceed58a06409c570fc7349ba1146f8be Mon Sep 17 00:00:00 2001 From: crucial707 Date: Thu, 25 Jan 2024 15:35:10 -0800 Subject: [PATCH 2/2] Lab 02 Austin Barnett --- src/Date.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/Date.java diff --git a/src/Date.java b/src/Date.java new file mode 100644 index 0000000..aaf7ad2 --- /dev/null +++ b/src/Date.java @@ -0,0 +1,19 @@ +// Created By: Austin Barnett +// Version 1.0 +// 1/25/24 +public class Date { + static String hello = "Hello World!"; + static String day = "Thursday"; + static int date = 25; + static String month = "January"; + static int year = 2024; + + + public static void main(String[] args) { + + + System.out.println(hello); + System.out.println("American:" + day + ", " + month + " " + date + ", " + year); + System.out.println("European:" + day + " " + year + "-" + month + "-" + date); + } +}