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

[hongyijie06] iP #179

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f0ecd9c
add chatbot name
hongyijie06 Jan 26, 2024
e0b6eed
Add echo
hongyijie06 Feb 7, 2024
35ec609
add Add,list
hongyijie06 Feb 7, 2024
0c16724
add mark as done
hongyijie06 Feb 9, 2024
1b6ca15
add A-CodingStandard
hongyijie06 Feb 9, 2024
6ef3078
add todo, deadline and event
hongyijie06 Feb 16, 2024
b540106
add code quality
hongyijie06 Feb 19, 2024
c230255
add error handling
hongyijie06 Feb 20, 2024
bedc8ec
make error handling more error-specific
hongyijie06 Feb 20, 2024
4793c54
Revert "make error handling more error-specific"
hongyijie06 Feb 20, 2024
c43aef3
Revert "Revert "make error handling more error-specific""
hongyijie06 Feb 20, 2024
e0bf4a2
add delete
hongyijie06 Feb 20, 2024
7078d98
Merge branch 'branch-Level-6'
hongyijie06 Feb 22, 2024
4de283c
settle errors
hongyijie06 Feb 22, 2024
e44d14e
add save
hongyijie06 Feb 22, 2024
011c695
resolve errors
hongyijie06 Feb 22, 2024
0bc39f6
Merge branch 'branch-Level-7'
hongyijie06 Feb 22, 2024
b1fd82d
fix formatting when listing tasks
hongyijie06 Mar 2, 2024
61216db
add saveToFile
hongyijie06 Mar 2, 2024
996ba2b
fix file not found error
hongyijie06 Mar 3, 2024
7162ac7
use more oop
hongyijie06 Mar 6, 2024
7a5826c
fix loading file errors
hongyijie06 Mar 6, 2024
4a60dbe
add find
hongyijie06 Mar 7, 2024
422ac12
Merge branch 'branch-Level-9'
hongyijie06 Mar 7, 2024
2152ef7
add javadoc
hongyijie06 Mar 7, 2024
b611a02
Merge pull request #1 from hongyijie06/branch-A-JavaDoc
hongyijie06 Mar 7, 2024
d141099
Merge branch 'master' of https://github.com/hongyijie06/ip
hongyijie06 Mar 7, 2024
6752306
Add user guide
hongyijie06 Mar 7, 2024
2f4b481
Format headers
hongyijie06 Mar 7, 2024
4f03af2
follow coding standards
hongyijie06 Mar 8, 2024
fbcc37c
add README pictures
hongyijie06 Mar 8, 2024
456bcb0
add pictures
hongyijie06 Mar 8, 2024
dc9a769
improve formatting, no pictures
hongyijie06 Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added src/main/java/Duke.class
Binary file not shown.
47 changes: 41 additions & 6 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,45 @@
import java.util.Scanner;

public class Duke {
public static void main(String[] args) {
String logo = " ____ _ \n"
+ "| _ \\ _ _| | _____ \n"
+ "| | | | | | | |/ / _ \\\n"
+ "| |_| | |_| | < __/\n"
+ "|____/ \\__,_|_|\\_\\___|\n";
System.out.println("Hello from\n" + logo);
String list[] = new String[100];

Choose a reason for hiding this comment

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

Do you think it would be more beneficial to have a more descriptive name like "tasks"?

Copy link
Author

Choose a reason for hiding this comment

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

That might be better! Thank you!


System.out.println("Hello! I'm apple");
System.out.println("What can I do for you?");

int index = 0;

Choose a reason for hiding this comment

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

I think there should be one more space here for a 4 tab space


String line = "";



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

Choose a reason for hiding this comment

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

I tried to look through the coding standard to see if there should be a space. There wasn't anything that specifically mentioned it, but all the examples had a space. It might be worth making this change throughout your code to keep it consistent.

Scanner input = new Scanner(System.in);
line = input.nextLine();

if (line.equals("bye")){
break;
}

if (line.equals("list")){
for (int i = 0; i < index; i ++) {

Choose a reason for hiding this comment

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

I think you can clean up random newlines like this

System.out.println((i + 1) + ". " + list[i]);
}
}else {

Choose a reason for hiding this comment

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

I think adding a space between the "}" and "else" will follow coding standard more and keep the style of your code more consistent

list[index] = line;
System.out.println("added: " + line);
}

index ++;




Choose a reason for hiding this comment

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

Additionally, I think you can clean up these new lines


}
System.out.println("Bye. Hope to see you again soon!");

Choose a reason for hiding this comment

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

you can try to use more methods e.g. sayBey() to make the program more extendable for the future levels.



}
}