Skip to content

[Gabriel Waikin Loh Matienzo] iP#504

Open
GabrielWLM wants to merge 40 commits into
nus-cs2103-AY2122S1:masterfrom
GabrielWLM:master
Open

[Gabriel Waikin Loh Matienzo] iP#504
GabrielWLM wants to merge 40 commits into
nus-cs2103-AY2122S1:masterfrom
GabrielWLM:master

Conversation

@GabrielWLM

Copy link
Copy Markdown

No description provided.

@GabrielWLM

GabrielWLM commented Sep 3, 2021

Copy link
Copy Markdown
Author

LUKE

"Luke, I am your father"

LUKE helps you remember your tasks, events and deadlines for you!

  • text-based
  • easy to learn
  • FAST SUPER FAST to use
  • All you need to do is,
  1. download it from here.
  2. double-click it.
  3. add your tasks.
  4. let it manage your tasks for you 😉

And it is FREE!

Features:

Managing tasks
Managing deadlines

  • Managing tasks
  • Managing deadlines
  • Reminders (coming soon)

Here's the main method

public class Main {
public static void main(String[] args) {
Application.launch(MainApp.class, args);
}
}

Comment thread src/main/java/Duke.java Outdated

String response = scanner.nextLine();

while (!response.equals("bye")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think you should try splitting the logic in this while loop into different files/methods

@RachelCheah RachelCheah left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The code seems to adhere to the coding standard specified overall!

@aakanshanarain aakanshanarain left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks alright! Not many errors regarding the coding standards here!

Comment thread src/main/java/Duke.java Outdated
+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);

ArrayList<String> list = new ArrayList<String>();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Variable 'list' could be more descriptive; i.e, describe the purpose of the variable

Comment thread src/main/java/Duke.java Outdated
int taskNo = Integer.parseInt(response.replaceAll("\\D", "")) - 1;
System.out.println(lineBreak);
System.out.println("\t Nice! I've marked this task as done:");
list.set(taskNo, list.get(taskNo).substring(0,4) + "X" + list.get(taskNo).substring(5));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

substring(0,4)
substring(0, 4)

Comment thread src/main/java/Duke.java Outdated
private static void save(ArrayList<String> tasks) throws IOException {
File f = new File("tasks.txt");
System.out.print(f.createNewFile());
FileWriter fw = new FileWriter("tasks.txt");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A longer, more descriptive name (like simply fileWriter) might be better here.

Comment thread src/main/java/Duke.java Outdated
list.add(amount, "[T][ ] " + response.substring(5));
amount++;
save(list);
} else if (response.matches("deadline .+")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For response matching, you might benefit from using Enums :)

Comment thread src/main/java/Duke.java Outdated
System.out.println("☹ OOPS!!! The description of an event cannot be empty.");
System.out.println(lineBreak);
} else {
System.out.println(lineBreak);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could consider abstracting the

System.out.println(lineBreak);
System.out.println(something);
System.out.println(lineBreak);

to avoid repeated code

@jivesh

jivesh commented Sep 5, 2021

Copy link
Copy Markdown

Good code, but you might benefit from splitting your logic into multiple files :)

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.

4 participants