Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added My program with errors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Partner's program with errors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ 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.**

**Reflection:**
* I attempted to stump my partner by including a few simple bugs. Most of the bugs were taking advantage of the case-sensitive nature of declaration and assignment statements. I also purposefully included some incorrect punctuation.I made sure the punctuation was similar to the correct style so as not to stand out too much. I also left out the last closing curly bracket to see if that would be noticed. Unfortunately, at the time of this submission my partner has not yet attempted to identify my bugs. I would recommend that they go line by line to look for punctuation and capitalization errors as well as paying attention to the type of variables that are declared and the format of the values assigned.
* The errors I found in my partner's code are as follows:
1. Static should not be capitalized.
2. The "minute" variable assignment should end with " ; ".
3. System should be capitalized.
4. There should be a space at the end of the string "the current time is".
5. The statement printing "hour" is printing a string containing the characters "hour". To return the value of the hour variable no quotations should be used.


---

## Part 2: Date Display Program
Expand Down
29 changes: 29 additions & 0 deletions src/Date.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
public class Date {
public static void main(String[] args) {

String day;
String month;
int date;
int year;
//Define variables

day = "Saturday";
month = "January";
date = 27;
year = 2024;
// Assign values to represent today's date.

System.out.println(day);
System.out.println(month);
System.out.println(date);
System.out.println(year);
//Display each variable's value on separate lines for initial verification.

//Compile and run

System.out.printf("%s, %s %d, %d\n", day, month, date, year);
//Display the date in standard American format.

System.out.printf("%s, %d %s %d", day, date, month, year);
}
}
22 changes: 21 additions & 1 deletion src/StumpTheChump.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
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("What is your name?");
String name = scanner.nextLine();

System.out.print("Hi ");
System.out.print(name);
System.out.println(", what year were you born?");

int yearOfBirth = scanner.nextInt();
int currentYear = 2024;

System.out.print(name);
System.out.print(", you are ");
System.out.print(currentYear - yearOfBirth);
System.out.print(" years old!");

}
}

}