Skip to content

Conversation

@euzintan
Copy link

No description provided.

Copy link

@BILLXYR BILLXYR left a comment

Choose a reason for hiding this comment

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

Two main problems observed: "the websites says: "Class variables should never be declared public"
So, perhaps it should not public." and " Plural form should be used on names representing a collection of objects." Others are fine 👍 Good job 👍

System.out.println("Hello from\n" + logo);
System.out.println(logo + "\nHello im Eu Zin's Duke, he spent thursday afternoon creating me cuz he forgot abt the iP");

ArrayList<Task> taskList = new ArrayList<>();
Copy link

Choose a reason for hiding this comment

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

From the websites it says that : "Plural form should be used on names representing a collection of objects."
So I think perhaps it should be taskLists instead of taskList.

@@ -0,0 +1,18 @@
public class Deadline extends Task {
Copy link

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

import java.util.Iterator;
import java.util.Scanner;

public class Duke {
Copy link

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

@@ -0,0 +1,7 @@
public class DukeException extends Throwable {
Copy link

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

@@ -0,0 +1,18 @@
public class Event extends Task{
Copy link

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

@@ -0,0 +1,21 @@
public class Task {
Copy link

Choose a reason for hiding this comment

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

the websites says: "Class variables should never be declared public"
So, perhaps it should not public.

Copy link

@juandavinlie juandavinlie left a comment

Choose a reason for hiding this comment

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

Overall, your code is well written and understandable. Some names of variables and methods can be modified to make it self-explanatory. Good job!!

boolean isDone = taskDataDivided[2].equals("1");
switch (taskDataDivided[0]) {
case "E":
returnTaskList.add(new Event(taskDataDivided[2], taskDataDivided[3], isDone));

Choose a reason for hiding this comment

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

Should taskDataDivided[0, 2, 3] be assigned to a variable that is self-descriptive? It would make the code easier to read and understand.

* @return copy of ArrayList
*/
public ArrayList<Task> getList() {
ArrayList<Task> returnTaskList = new ArrayList<>();

Choose a reason for hiding this comment

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

It might be more appropriate to name this variable as taskList instead of returnTaskList since return is a verb and could refer to a function.

Comment on lines +76 to +77
* Add Task given to the list
* @param task

Choose a reason for hiding this comment

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

It is good to separate the description and parameter using a blank line.

public ArrayList<Task> searchFor(String searchString) {
ArrayList<Task> returnArrayList = new ArrayList<>();
for (Task task : taskList) {
if (task.getDescription().contains(searchString)) returnArrayList.add(task);

Choose a reason for hiding this comment

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

It may be better to use the Egyptian style when writing if-else statement as it becomes easier to read.

return taskList.size();
}

public ArrayList<Task> searchFor(String searchString) {

Choose a reason for hiding this comment

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

May be better to name it searchTaskWithName(String searchString), as it is understandable by just reading it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants