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

[beefsausagee] iP #457

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
55f9f9f
docs/README.md: Tweak document template
Jan 7, 2024
f837ddb
Add Gradle support
May 24, 2020
a6f7324
Bump gradle and lib version
Eclipse-Dominator Aug 5, 2023
b19d562
Implement changes for Level-0
alvislowyh Feb 1, 2024
85dcedc
Level 1
alvislowyh Feb 2, 2024
8380b0e
Level-2
alvislowyh Feb 2, 2024
98302d6
Level 3. Mark As Done
alvislowyh Feb 6, 2024
e597f5e
Level 3. Mark As Done
alvislowyh Feb 6, 2024
22274ba
Level 4. ToDos, Events, Deadlines
alvislowyh Feb 7, 2024
e7c4c66
Level 5. Handle Errors
alvislowyh Feb 7, 2024
f5ba09f
Level 5. Handle Errors
alvislowyh Feb 7, 2024
8031d99
Level 6. Delete
alvislowyh Feb 7, 2024
676000f
Level 6. Delete
alvislowyh Feb 7, 2024
6cd69dc
Text UI Testing
alvislowyh Feb 9, 2024
2795a19
Level-7
alvislowyh Feb 13, 2024
d1ae4d1
Level 8
alvislowyh Feb 14, 2024
e09a661
Level 8
alvislowyh Feb 15, 2024
9879c00
Implemented changes for MoreOOP
alvislowyh Feb 16, 2024
7630968
Implemented changes for packages
alvislowyh Feb 16, 2024
48daa44
Merge branch 'add-gradle-support'
alvislowyh Feb 16, 2024
c9b9ea9
Added JUnit Test for Deadline class and Event class
alvislowyh Feb 16, 2024
da7892d
Package the App as a JAR file
alvislowyh Feb 16, 2024
51672c1
Add JavaDoc comments
alvislowyh Feb 16, 2024
eb187d4
Tweak the code to comply with a coding standard
alvislowyh Feb 16, 2024
d92ee08
Implement changes for Level-9
alvislowyh Feb 16, 2024
847b1f8
Merge changes from branch-Level-9
alvislowyh Feb 16, 2024
6b47835
Merge branch 'branch-Level-9'
alvislowyh Feb 16, 2024
e1dfcd8
Merge changes from branch-A-JavaDoc
alvislowyh Feb 16, 2024
1a7fa85
Implement changes to Duke and Task
alvislowyh Feb 16, 2024
08e649b
Implement changes to Duke
alvislowyh Feb 16, 2024
882183b
Add comments to Ui and Duke
alvislowyh Feb 16, 2024
49a2820
Merge branch 'branch-A-CodingStandard'
alvislowyh Feb 16, 2024
a514e94
Implement changes for Level 10
alvislowyh Feb 21, 2024
def0e91
Implement changes for Level-10
alvislowyh Feb 22, 2024
8521af1
Add XiaoBai and User image
alvislowyh Feb 22, 2024
0c57575
Change Duke to XiaoBai
alvislowyh Feb 22, 2024
af87374
Implement changes: Duke to XiaoBai
alvislowyh Feb 22, 2024
986b26b
Implement changes for code quality
alvislowyh Feb 22, 2024
456decf
Add assertions to improve input validation and error handling
alvislowyh Feb 22, 2024
ecbb3a0
Merge pull request #2 from beefsausagee/branch-A-Assertions
alvislowyh Feb 22, 2024
e3345b9
Add Javadoc comments to all classes in the project
alvislowyh Feb 22, 2024
4f38f31
Merge pull request #3 from beefsausagee/branch-A-CodeQuality
alvislowyh Feb 22, 2024
2972aaa
Removed txt file
alvislowyh Feb 22, 2024
d6e6b0f
Implement changes to tasks
alvislowyh Feb 22, 2024
e2495aa
Added extension C-Sort
alvislowyh Feb 23, 2024
57dc2af
Merge pull request #4 from beefsausagee/branch-C-Sort
alvislowyh Feb 23, 2024
b0c3bae
Implemented separate methods for processing todo, deadline, event, ma…
alvislowyh Feb 23, 2024
65484bd
Merge branch 'master' of https://github.com/beefsausagee/ip
alvislowyh Feb 23, 2024
6e6c6e3
Implement changes to Storage, UI, XiaoBai
alvislowyh Feb 23, 2024
ee38c98
Implement changes to text outcome to include personality for XiaoBai
alvislowyh Feb 25, 2024
782753b
Implemented changes to MainWindow.fxml to change design of GUI window
alvislowyh Feb 25, 2024
4f0bc96
Implemented changes to README.md
alvislowyh Feb 25, 2024
ad10551
Implemented changes for assertions
alvislowyh Feb 25, 2024
66f4897
Implemented changes to README.md
alvislowyh Feb 25, 2024
e256bc0
Implemented changes to README.md
alvislowyh Feb 25, 2024
edd5820
Implemented changes to runtest
alvislowyh Feb 25, 2024
69c11da
Implemented changes to Storage
alvislowyh Feb 25, 2024
e69e059
Implemented changes to UG
alvislowyh Feb 25, 2024
4169926
Add additional date and time formats
alvislowyh Feb 26, 2024
dd10ff6
Implement changes to parser
alvislowyh Feb 26, 2024
b79ce5f
Implement changes to Storage description
alvislowyh Feb 26, 2024
96c70a1
Implement changes to Ui for personality
alvislowyh Feb 26, 2024
8b620c5
Implement changes to XiaoBaiException to only display error message
alvislowyh Feb 26, 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.
77 changes: 70 additions & 7 deletions src/main/java/Duke.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,73 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

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

public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> listOfStrings = new ArrayList<>();
boolean hasEnded = false;
String botName = "Yube";
int counter = 1;

greet(botName);
while (!(hasEnded)) {
String input = reader.readLine();
if (input.equals("bye")) {
bye();
hasEnded = true;
} else if (input.equals("list")) {
printList(listOfStrings);
} else {
repeatFunction(input);
listOfStrings.add(String.format("%s. %s\n", counter, input));
counter++;
}
}
}

/**
* Displays a greeting message
Copy link

Choose a reason for hiding this comment

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

I think the sentence should end with a fullstop. I noticed the same issue in several other places too.

*
* @param botName Name of the bot
Copy link

Choose a reason for hiding this comment

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

Likewise, I think each parameter description should end with a fullstop. I noticed the same issue in several other places too.

*/
public static void greet(String botName) {
System.out.println(String.format(
"%sHello! I'm %s \nWhat can I do for you? \n%s", LINE, botName, LINE));
}

/**
* Displays a farewell message
*/
public static void bye() {
System.out.println(String.format(
"%sBye. Hope to see you again soon! \n%s", LINE, LINE));
}

/**
* Displays a repeated message of the input by the user
*
* @param input User input
*/
public static void repeatFunction(String input) {
System.out.println(String.format("%sadded: %s\n%s", LINE, input, LINE));
}

/**
* Displays the list of Strings
*
* @param listOfStrings list of Strings
*/
public static void printList(ArrayList<String> listOfStrings) {
StringBuilder finalString = new StringBuilder();
finalString.append(LINE);
for (String c : listOfStrings) {
finalString.append(c);
}
finalString.append(LINE);
System.out.println(finalString.toString());
}
}