-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Boo Wen Jun] iP #454
base: master
Are you sure you want to change the base?
[Boo Wen Jun] iP #454
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only looked at Code Quality → Naming, this is from week 4, W4.6, take note of this to improve your code and use it in the future as well. Well Done!
src/main/java/marsException.java
Outdated
public class marsException extends RuntimeException{ | ||
public marsException(String message){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class marsException extends RuntimeException{ | |
public marsException(String message){ | |
public class MarsException extends RuntimeException{ | |
public MarsException(String message){ |
I noticed that the class name marsException does not follow the PascalCase convention for class names. According to the coding standard, class names should be nouns and written in PascalCase. Consider renaming it to MarsException to align with the standard.
src/main/java/Task.java
Outdated
protected String description; | ||
protected boolean isDone; | ||
|
||
public Task(String description) { | ||
this.description = description; | ||
this.isDone = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"I like how you used a boolean variable name like isDone, which follows the convention of starting with 'is' to indicate a boolean value. This makes the code more readable and intuitive. Good job!
src/main/java/Mars.java
Outdated
|
||
public class Mars { | ||
public static void main(String[] args) { | ||
List<Task> arrayList = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List<Task> arrayList = new ArrayList<>(); | |
List<Task> taskList = new ArrayList<>(); |
The variable name arrayList could be improved to better describe its purpose. Since this is a collection of tasks, consider renaming it to tasks or taskList.
src/main/java/Mars.java
Outdated
} | ||
|
||
/*Level 2. Add, List */ | ||
private void store(List<Task> arrayList){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method name store() is a bit ambiguous as it doesn't clearly explain what it does. Based on its functionality, a more descriptive name like addAndListTasks() or manageTasks() would better convey its purpose and improve code clarity
…ts children) class into relevant packages
… improve code readability Changed echo() to static method
…to static implementations as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I found your code fine and easy to understand. You can improve your codes by following the coding style and splitting codes into multiple classes to engage more OOP.
src/main/java/Mars.java
Outdated
"____________________________________________________________\n" + | ||
" Bye. Hope to see you again soon!\n" + | ||
"____________________________________________________________"); */ | ||
try{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try{ | |
try { |
A space should be inserted here.
src/main/java/Mars.java
Outdated
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
else { | |
} else { |
Should be modified to follow the coding conventions.
src/main/java/Mars.java
Outdated
String description = reader.nextLine(); | ||
System.out.println("____________________________________________________________\n"); | ||
switch(taskType){ | ||
case "todo": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should not be any indent before "case" statements.
src/main/java/Mars.java
Outdated
private void mark(List<Task> lst){ | ||
Object[] taskArray = lst.toArray(); | ||
|
||
Scanner reader = new Scanner(System.in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you think that the creation of a new Object[]
is redundant here?
My suggestion is to remove this line and get the task object directly from the given List<task>
as lst.get(num - 1)
.
… data structure to be ArrayList across all methods
…raction of bye() and greet() methods into UI class.
…AL_LINE constant at the start of execute() as that functionality has been abstracted into UI class
…s.java and puts it in the build/libs folder
Final JAR file created for version release
Moved Ui.png to root
Mars User Guide
Introducing MARS! A personal tasklist chatbot to help you better organise your day
Ever get overwhelmed with Deadlines, Events, ToDos, and DoWithins?
Here is an assistant with a minimalist UI for you! 😄
Sneak Peek
Get started
Download the .jar file of your desired version.
Double-click and open file.
The application is ready for use! Start adding tasks and performing other actions.
Here are the types of Tasks available:
To add a Todo:
format: todo {task name}
e.g. todo read book
To add a deadline:
format: deadline {task name} (by: MMM dd yyyy, h:mm a)
e.g. deadline return book (by: Feb 02 2024, 6:00 pm)
To add an Event:
format: event {task name} (from: MMM dd yyyy, h:mm a to MMM dd yyyy, h:mm a)
e.g. event CS2103T project meeting (from: Feb 28 2024, 6:00 am to: Mar 03 2024, 8:00 am)
To add a DoWithin, run:
format: do within {task name} between: MMM dd yyyy, h:mm a and MMM dd yyyy, h:mm a
e.g. collect certificate between: Jan 15 2024, 6:00 pm and Jan 25 2024, 6:00 pm
If tasks are added successfully, the output would be:
Features:
Deleting a task
Format: delete {task number}
eg. delete 1
Marking a task
Format: mark {task number}
eg. mark 1
Unmarking a task
Format: unmark {task number}
eg. unmark 1
List
Format: list
e.g. list
Find a task through keyword
Format: find {keyword}
eg. find book