Skip to content
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

[Guoyi] ip #109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[Guoyi] ip #109

wants to merge 1 commit into from

Conversation

gu0y1
Copy link

@gu0y1 gu0y1 commented Sep 4, 2024

No description provided.

@gu0y1 gu0y1 changed the title Add functionality to mark and unmark tasks as done [Guoyi] ip Sep 4, 2024
Copy link

@ryryry-3302 ryryry-3302 left a comment

Choose a reason for hiding this comment

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

Looks good just some minor suggestions!


while (true) {
input = scanner.nextLine();
if (input.equals("bye")) {

Choose a reason for hiding this comment

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

Instead of using a long list of else ifs you could consider re factoring this into switch case form to improve readability. Just a suggestion!


class Task {
protected String description;
protected boolean isDone;

Choose a reason for hiding this comment

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

Great job following the naming conventions for boolean variables!

System.out.println("Now you have " + taskCount + " tasks in the list.");
} else if (input.startsWith("deadline ")) {
String[] parts = input.substring(9).split(" /by ");
tasks[taskCount] = new Deadline(parts[0], parts[1]);

Choose a reason for hiding this comment

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

You could consider adding some edge case catchers here to remind user the correct argument usage.
For example, if the user forgets to put /by you could print out something like expected argument containing /by

}

class Event extends Task {
protected String from;

Choose a reason for hiding this comment

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

Great job keeping all variables in protected accessibility to improve security of your object's members!

Copy link

@joshuan98 joshuan98 left a comment

Choose a reason for hiding this comment

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

Instead of putting all your code in a single file, consider using separate files instead.

System.out.println("What can I do for you?");

Scanner scanner = new Scanner(System.in);
Task[] tasks = new Task[100];
Copy link

@joshuan98 joshuan98 Sep 16, 2024

Choose a reason for hiding this comment

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

You can avoid the use of 100 here which is a magic number.

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