Loh Zhi Qin iP#668
Conversation
In build.gradle, the dependencies on distZip and/or distTar causes
the shadowJar task to generate a second JAR file for which the
mainClass.set("seedu.duke.Duke") does not take effect.
Hence, this additional JAR file cannot be run.
For this product, there is no need to generate a second JAR file
to begin with.
Let's remove this dependency from the build.gradle to prevent the
shadowJar task from generating the extra JAR file.
| System.out.println("Hello from\n" + logo); | ||
|
|
||
| while (scanner.hasNextLine()) { | ||
| String line = scanner.nextLine(); |
There was a problem hiding this comment.
You could rename this to userInput instead to make it more clear
| String[] content = details.split(" /by "); | ||
| inst.addTask(new Deadline(content[0], content[1])); | ||
| } | ||
| else if (line.startsWith("event")) { |
There was a problem hiding this comment.
else if statement should be one line up to follow style of previous else if statements
| } | ||
|
|
||
| public static void main(String[] args) { | ||
| Skye inst = new Skye(); |
There was a problem hiding this comment.
You could rename this to instanceSkye
| String[] time = details.split(" /from ")[1].split(" /to "); | ||
| inst.addTask(new Event(description, time[0], time[1])); | ||
| } | ||
| } |
There was a problem hiding this comment.
What if the user enters a command that is not recognised? I think there should be an else statement to handle that case
TeeJinSeng
left a comment
There was a problem hiding this comment.
Overall is still quite good, just that there are some minor mistakes and might need to handle more possible user input error that need to be fixed.
| @@ -45,7 +47,7 @@ public void markTask(int number) { | |||
| */ | |||
| public void unmarkTask(int number) { | |||
| printString("Ok, I have marked the task below as incomplete:"); | |||
There was a problem hiding this comment.
For the sake of consistency with markTask, can move this line of printString 2 lines below, also printString should be done after the process is finished.
| } | ||
| } else { | ||
| inst.addTask(line); | ||
| } else if (line.startsWith("todo")) { |
There was a problem hiding this comment.
Can I have todosdescription here? Does your code treat it as invalid or as a valid command to create ToDo?
| @@ -0,0 +1,11 @@ | |||
| public class ToDo extends Task{ | |||
There was a problem hiding this comment.
need a space between "... extends Task" and "{"
| @@ -0,0 +1,13 @@ | |||
| public class Deadline extends Task{ | |||
There was a problem hiding this comment.
need a space between "... extends Task" and "{"
| @@ -0,0 +1,15 @@ | |||
| public class Event extends Task{ | |||
There was a problem hiding this comment.
need a space between "... extends Task" and "{"
| taskName = name; | ||
| isComplete = false; | ||
| this.taskName = name; | ||
| this.isComplete = false; |
There was a problem hiding this comment.
Actually in this course, it is recommended to avoid unnecessary this keyword, you can refer to this:
https://se-education.org/guides/conventions/java/index.html#variables
# Conflicts: # src/main/java/Skye/classes/Skye.java
Skye
A new instance of
Skyecan be generated byYou may download the source code from here. And it is FREE.
Some features we have developed