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

[Gabriel Waikin Loh Matienzo] iP #504

Open
wants to merge 40 commits into
base: master
Choose a base branch
from

Conversation

GabrielWLM
Copy link

No description provided.

@GabrielWLM
Copy link
Author

GabrielWLM commented Sep 3, 2021

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);
}
}


String response = scanner.nextLine();

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

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

Copy link

@RachelCheah RachelCheah left a comment

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!

Copy link

@aakanshanarain aakanshanarain left a comment

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!

+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);

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

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

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));

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)

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

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.

list.add(amount, "[T][ ] " + response.substring(5));
amount++;
save(list);
} else if (response.matches("deadline .+")) {
Copy link

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 :)

System.out.println("☹ OOPS!!! The description of an event cannot be empty.");
System.out.println(lineBreak);
} else {
System.out.println(lineBreak);
Copy link

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
Copy link

jivesh commented Sep 5, 2021

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