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

[Kherlen Bayasgalan] iP #82

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

Conversation

Brian030601
Copy link

No description provided.

@@ -1,4 +1,4 @@
import java.util.*;
import java.util.Scanner;
public class Duke {
public static String BOT_NAME = "Amy"; // a constant bot name
Copy link

Choose a reason for hiding this comment

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

Add the "final" modifier to prevent BOT_NAME from being changed at all throughout your program's runtime.

public static void listTasks() {
System.out.println("Here are the tasks in your list:");
for (int i = 0; i < numberOfTasks; i++) {
System.out.println((i + 1) + ". " + taskList[i]); // list if the user enters list
Copy link

Choose a reason for hiding this comment

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

Some of these comments are redundant as it is already made clear in your program what they are made to do

add_List();
Scanner scanner = new Scanner(System.in);
while (true) {
String userInput = scanner.nextLine(); // Read user input
Copy link

Choose a reason for hiding this comment

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

Here is another example

String userInput = scanner.nextLine(); // Read user input
System.out.println("____________________________________________________________");
if (userInput.equals("bye")) {
break; // Exit the loop if the user enters "bye"
Copy link

Choose a reason for hiding this comment

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

As well as this

isDone = false;
}
public String getStatusIcon() {
return (isDone ? "X" : " "); // mark done task with X
Copy link

Choose a reason for hiding this comment

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

This one as well

if (userInput.equals("bye")) {
break; // Exit the loop if the user enters "bye"
} else if (userInput.equals("list")) {
listTasks(); // list tasks

Choose a reason for hiding this comment

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

Remove comments which are very obvious and keep the number of comments minimal

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