Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
876151e
Add level 0 increment
irfandeen Jan 21, 2025
e614df3
Remove unused variables in WallE.java
irfandeen Jan 21, 2025
bf9e4bd
Add echo command functionality
irfandeen Feb 2, 2025
290ffb1
Add list to store and list out tasks
irfandeen Feb 2, 2025
90a643a
Add mark and unmark functionality to task list
irfandeen Feb 2, 2025
827efec
Create Task class to represent tasks
irfandeen Feb 2, 2025
7fec201
Modify code to adhere to coding standard
irfandeen Feb 2, 2025
b578e77
Add subclasses extending Task class
irfandeen Feb 11, 2025
a2e877e
Add toString() method to base class
irfandeen Feb 11, 2025
9c6ad3e
Refactor WallE class to improve readability
irfandeen Feb 11, 2025
46c910b
Add try catch for all exceptions
irfandeen Feb 15, 2025
39abee7
Fix toString() methods
irfandeen Feb 15, 2025
1918418
Add error handling
irfandeen Feb 15, 2025
cbafecb
Merge branch 'branch-Level-5'
irfandeen Feb 15, 2025
6578450
Add Wall-E Exception class
irfandeen Feb 15, 2025
5ca2ee5
Refactor code into Wall-E package
irfandeen Feb 15, 2025
03306fb
feature: allow multi-word dates for events and deadlines
irfandeen Feb 21, 2025
bba9299
Refactor Task array into ArrayList for dynamic access
irfandeen Feb 21, 2025
e601a9f
Add delete task functionality
irfandeen Feb 21, 2025
43d21ea
Add file parser. Processing file parser output TBC
irfandeen Feb 22, 2025
45037e0
feature: persistence with text file
irfandeen Feb 22, 2025
34ff431
Merge branch 'branch-Level-6'
irfandeen Feb 22, 2025
0aec5e3
Resolve merge conflicts
irfandeen Feb 22, 2025
43b40c8
Fix bugs arising from ArrayList access
irfandeen Feb 22, 2025
e0c8602
Add JAR manifest
irfandeen Feb 22, 2025
543da72
Refactor to be more modularized. Full functionality not yet restored.
irfandeen Mar 6, 2025
31afe02
Refactor complete. Fully functional and modularized
irfandeen Mar 6, 2025
9e75e32
Add date time functionality to deadline
irfandeen Mar 7, 2025
da8b95b
Fix code style nit
irfandeen Mar 7, 2025
fe47074
Add find functionality to WallE
irfandeen Mar 7, 2025
e6338cd
Add JavaDoc comments for public methods and classes.
irfandeen Mar 7, 2025
826535c
Merge pull request #1 from irfandeen/branch-Level-8
irfandeen Mar 7, 2025
bff51c2
Resolve conflicts between Find functionality and DateTime functionality
irfandeen Mar 7, 2025
0f2aa02
Merge pull request #2 from irfandeen/branch-Level-9
irfandeen Mar 7, 2025
300372a
Resolve conflicts between master and JavaDoc branch
irfandeen Mar 7, 2025
a1a16ed
Merge pull request #3 from irfandeen/branch-A-JavaDoc
irfandeen Mar 7, 2025
d13d5bd
Add Readme.md
irfandeen Mar 7, 2025
a106526
Fix bugs with deadline command
irfandeen Mar 12, 2025
642d36b
Add input into UserInterface class
irfandeen Mar 12, 2025
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Duke project template
# WallE project template

This is a project template for a greenfield Java project. It's named after the Java mascot _Duke_. Given below are instructions on how to use it.

Expand All @@ -13,7 +13,7 @@ Prerequisites: JDK 17, update Intellij to the most recent version.
1. If there are any further prompts, accept the defaults.
1. Configure the project to use **JDK 17** (not other versions) as explained in [here](https://www.jetbrains.com/help/idea/sdk.html#set-up-jdk).<br>
In the same dialog, set the **Project language level** field to the `SDK default` option.
1. After that, locate the `src/main/java/Duke.java` file, right-click it, and choose `Run Duke.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
1. After that, locate the `src/main/java/WallE.java` file, right-click it, and choose `Run WallE.main()` (if the code editor is showing compile errors, try restarting the IDE). If the setup is correct, you should see something like the below as the output:
```
Hello from
____ _
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Duke User Guide
# WallE User Guide

// Update the title above to match the actual product name

Expand Down
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

21 changes: 21 additions & 0 deletions src/main/java/Task.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
public class Task {
protected String description;
protected boolean isDone;

public Task(String description) {
this.description = description;
this.isDone = false;
}

public String getStatusIcon() {
return (isDone ? "X" : " ");
}

public void markAsDone() {
isDone = true;
}

public void unmarkAsDone() {
isDone = false;
}
}
79 changes: 79 additions & 0 deletions src/main/java/WallE.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import java.util.Scanner;

public class WallE {
public static void printLineBreak() {
String lineBreak = "\t_________________________________\n";
System.out.print(lineBreak);
}

public static void printWithLineBreak(String response) {
printLineBreak();
System.out.println("\t" + response);
printLineBreak();
}

public static void printWithoutLineBreak(String response) {
System.out.println("\t" + response);
}

public static void printGreeting() {
String greeting = "Hello! I'm Wall-E!\n" + "\tWhat can I do for you?\n\n";
printWithLineBreak(greeting);
}

public static void printExit() {
String exitMessage = "Bye. Hope to see you again soon!";
printWithLineBreak(exitMessage);
}

public static void printTaskList(Task[] tasks, int size) {
printLineBreak();
printWithoutLineBreak("Here are the tasks in your list: ");
for (int i = 0; i < size; i++) {
printWithoutLineBreak(Integer.toString(i + 1) + ". [" + tasks[i].getStatusIcon() + "] "
+ tasks[i].description);
}
printLineBreak();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very neat code for the different functions!


public static void main(String[] args) {
printGreeting();
Scanner reader = new Scanner(System.in);
String userInput = reader.nextLine();
Task[] tasks = new Task[100];
int size = 0;

// Echoes the input, unless input == bye
while (!userInput.equals("bye")) {
String[] params = userInput.split(" ");
int taskIndex = 0;

switch (params[0]) {
case "list":
printTaskList(tasks, size);
break;
case "mark":
taskIndex = Integer.parseInt(params[1]);
tasks[taskIndex - 1].markAsDone();
printWithLineBreak("Nice! I've marked this task as done:\n"
+ "\t [" + tasks[taskIndex - 1].getStatusIcon() + "] "
+ tasks[taskIndex - 1].description);
break;
case "unmark":
taskIndex = Integer.parseInt(params[1]);
tasks[taskIndex - 1].unmarkAsDone();
printWithLineBreak("OK, I've marked this task as not done yet:\n"
+ "\t " + "[ ] " + tasks[taskIndex - 1].description);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of string concatenation for readability!

break;
default:
tasks[size] = new Task(userInput);
size++;
printWithLineBreak("added: " + userInput);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat use of switch to handle the commands!


userInput = reader.nextLine();
}

printExit();
}
}
2 changes: 1 addition & 1 deletion text-ui-test/runtest.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ IF ERRORLEVEL 1 (
REM no error here, errorlevel == 0

REM run the program, feed commands from input.txt file and redirect the output to the ACTUAL.TXT
java -classpath ..\bin Duke < input.txt > ACTUAL.TXT
java -classpath ..\bin WallE < input.txt > ACTUAL.TXT

REM compare the output to the expected output
FC ACTUAL.TXT EXPECTED.TXT