diff --git a/README.md b/README.md index 931badb..35df62e 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ 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.** +Kelten speaking here I played this game with one of my friends that also has learned coding with me in the past and has alot of experience with it but no so much Java so the playing field was basically even + +First 3 rounds went with clever ways to suprised both us of using things such as swaping 2 letters around Main so it spelled Mian instead removing single points that without broke the whole thing the stupid thing that leads to me as the victor is I change 4 small things to see if he could catch them he found 3 and was confidant he got it but realized the 4th was no where in sight so he gave up after that and I was victorious. If your wondering it was changing the [] to (). + --- ## Part 2: Date Display Program diff --git a/src/StumpTheChump.java b/src/StumpTheChump.java index dffc096..62b4679 100644 --- a/src/StumpTheChump.java +++ b/src/StumpTheChump.java @@ -1,6 +1,38 @@ -public class StumpTheChump { - // Initially working program. +//Kelten Stowe +//Trevor Hartman + +//1/27/23 + +import java.time.LocalDate; + +class Date { public static void main(String[] args) { - System.out.println("Hi Chump, can you be stumped?"); + // Step 1: Define variables + String day, date, month, year; + + // Step 2: Get today's date + LocalDate today = LocalDate.now(); + + // Step 3: Convert date components to strings + day = today.getDayOfWeek().toString().substring(0, 3); + date = Integer.toString(today.getDayOfMonth()); + month = today.getMonth().toString().substring(0, 3); + year = Integer.toString(today.getYear()); + + // Step 4: Display date in a specific format + System.out.println("Day: " + day); + System.out.println("Date: " + date); + System.out.println("Month: " + month); + System.out.println("Year: " + year); + + // Step 5: Display date in standard American format + System.out.println(month + ("/") + date + ("/") + year); + + // Step 6: Display date in European format + System.out.println(date + ("/") + month + ("/") + year); + + // Editors Note here I wanted to make a universal clock not just a standard one so it was consistant and my stubborness got the better of me which is why I'm submitting this last minute + // I ended up looking a lot of stuff online because everything I tried wasn't working and troubleshooting and I was running outta patience so I started looking up stuff online and every example I kept seeing used stuff built into the program so I gave in a used them + // Thanks for reading this and sorry for the wait I'll try and get this in earlier next time I know you guys don't like when people submit things last minute. } -} +} \ No newline at end of file