[Ayushi Yadav] iP#125
Open
ayushi0803 wants to merge 38 commits into
Open
Conversation
In this commit, if a user enters a command then the system echos the commands back. The user can also add anything to the list and store it, and view the list. Upon finishing a task, it can be marked as done, and vice versa. The Intellij Java Google Style coding standard has been implemented
…todo, event or deadline and mark or unmark either of the aforementioned off their list. They can aso view their list along with the task completion status.
* branch-Level-5: this commit adds all my current work to github again
…ou want to delete any item in the list then you can enter the delete command to amend the list respectively.
* branch-Level-6: level 6 commit that has additional spaces to test branching
…nputs change based on whatever the user enters. the Duke file consists of the ameded code to include the save feature
…riate error messages as and when needed. this helps in making the code more robust and user friendly
… rectify the branching - the previous commit enabled the code to deal with errors
Kobot7
reviewed
Sep 21, 2024
| } else { | ||
| handleAddCommand(input); | ||
| } | ||
| } catch (DukeException e) { |
There was a problem hiding this comment.
Is the variable name "e" informative enough?
| FileWriter writer = new FileWriter(FILE_PATH); | ||
| for (int i = 0; i < taskCount; i++) { | ||
| Task task = tasks[i]; | ||
| writer.write("T | " + (task.isDone ? "1" : "0") + " | " + task.description + "\n"); |
There was a problem hiding this comment.
Would be good to assign magic strings to a named constant instead
Comment on lines
+11
to
+61
| public static void main(String[] args) { | ||
| // Print the welcome message | ||
| System.out.println("____________________________________________________________"); | ||
| System.out.println(" Hello! I'm Ruhi."); | ||
| System.out.println(" What can I do for you?"); | ||
| System.out.println("____________________________________________________________"); | ||
|
|
||
| // Load existing tasks from file | ||
| loadTasksFromFile(); | ||
|
|
||
| // Initialize a scanner to read user input | ||
| Scanner scanner = new Scanner(System.in); | ||
|
|
||
| while (true) { | ||
| try { | ||
| String input = scanner.nextLine(); | ||
| System.out.println("____________________________________________________________"); | ||
|
|
||
| if (input.equals("bye")) { | ||
| System.out.println(" Bye. Hope to see you again soon!"); | ||
| System.out.println("____________________________________________________________"); | ||
| break; | ||
| } else if (input.equals("list")) { | ||
| // Display the list of tasks | ||
| System.out.println(" Here are the tasks in your list:"); | ||
| for (int i = 0; i < taskCount; i++) { | ||
| System.out.println((i + 1) + "." + tasks[i]); | ||
| } | ||
| System.out.println("____________________________________________________________"); | ||
| } else if (input.startsWith("mark")) { | ||
| handleMarkCommand(input); | ||
| } else if (input.startsWith("unmark")) { | ||
| handleUnmarkCommand(input); | ||
| } else if (input.startsWith("delete")) { | ||
| handleDeleteCommand(input); | ||
| } else if (input.trim().isEmpty()) { | ||
| throw new DukeException("Oops! Task description cannot be empty."); | ||
| } else { | ||
| handleAddCommand(input); | ||
| } | ||
| } catch (DukeException e) { | ||
| System.out.println(e.getMessage()); | ||
| System.out.println("____________________________________________________________"); | ||
| } catch (Exception e) { | ||
| System.out.println("Oopsy daisy! Something went wrong, check again."); | ||
| System.out.println("____________________________________________________________"); | ||
| } | ||
| } | ||
|
|
||
| scanner.close(); | ||
| } |
There was a problem hiding this comment.
Consider extracting parts of the code the a separate method to avoid having long methods
pushing all branches to my fork
…, Parser and clean up the Duke and Task files
* A-MoreOOP: Refactor Duke to A-MoreOOP structure: extracted Ui, Storage, TaskList, Parser and clean up the Duke and Task files
… meaningfully to store the correct outputs in the list.
* A-JavaDoc: adding header comments to methods and classes.
* 'master' of https://github.com/ayushi0803/ip: Update README.md
Jk2987
approved these changes
Nov 3, 2024
Jk2987
approved these changes
Nov 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.