Skip to content

Commit e9f4af9

Browse files
friedrice231friedrice231
authored andcommitted
Update Printer.Java to give the user responses more personality
1 parent b663db7 commit e9f4af9

File tree

1 file changed

+29
-21
lines changed

1 file changed

+29
-21
lines changed

src/main/java/pawpal/utils/Printer.java

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,45 @@ public class Printer {
1111

1212
// Added methods for greeting, bye, and error messages
1313
public static String getGreetingMessage(String appName) {
14-
return "Hello from " + appName + "!\nWhat can I do for you?";
14+
return "Meow there! Welcome to " + appName + "!\nHow can I help you pounce on your tasks today?";
1515
}
1616

1717
public static String getByeMessage() {
18-
return "Goodbye! Hope to see you again soon!";
18+
return "Farewell, human! May your naps be long and your adventures many! Meow!";
1919
}
2020

2121
public static String getLoadingErrorMessage() {
22-
return "Error loading tasks from file.";
22+
return "Oops! I tripped over a yarn ball while loading tasks from file.";
2323
}
2424

2525
public static String getSavingErrorMessage() {
26-
return "Error saving tasks to file.";
26+
return "Uh-oh! A sneaky cat toy got in the way while saving tasks to file.";
2727
}
2828

2929
// Existing task-related messages
3030
public static String getTaskAddedMessage(String description, int taskCount) {
31-
return "Task added: " + description + "\nNow you have " + taskCount + " tasks.";
31+
return "Purrfect! I've added the task: " + description
32+
+ "\nNow you have " + taskCount + " tasks to chase.";
3233
}
3334

3435
public static String getTaskDeletedMessage(Task task, int taskCount) {
35-
return "Task removed: " + task + "\nNow you have " + taskCount + " tasks left.";
36+
return "I've swiped away the task: " + task
37+
+ "\nNow there are " + taskCount + " tasks remaining in your kitty checklist.";
3638
}
3739

3840
public static String getTaskMarkedMessage(Task task) {
39-
return "Task marked as done:\n" + task;
41+
return "That task is now purr-fectly completed:\n" + task;
4042
}
4143

4244
public static String getTaskUnmarkedMessage(Task task) {
43-
return "Task marked as not done:\n" + task;
45+
return "Even the best cats need a second try. Task reset to not done:\n" + task;
4446
}
4547

4648
public static String getTaskListString(List<Task> tasks) {
4749
if (tasks.isEmpty()) {
48-
return "No tasks in your list!";
50+
return "Your task list is as empty as a food bowl before dinner!";
4951
}
50-
StringBuilder sb = new StringBuilder("Here are your tasks:\n");
52+
StringBuilder sb = new StringBuilder("Here are your tasks, ready for a purr-fect day:\n");
5153
for (int i = 0; i < tasks.size(); i++) {
5254
sb.append((i + 1)).append(". ").append(tasks.get(i)).append("\n");
5355
}
@@ -56,40 +58,46 @@ public static String getTaskListString(List<Task> tasks) {
5658

5759
public static String getMatchingTasksMessage(List<Task> tasks) {
5860
if (tasks.isEmpty()) {
59-
return "No matching tasks found.";
61+
return "No matching tasks found. Did the cat hide them?";
6062
}
61-
StringBuilder sb = new StringBuilder("Matching tasks:\n");
63+
StringBuilder sb = new StringBuilder("Here are your matching tasks:\n");
6264
for (int i = 0; i < tasks.size(); i++) {
6365
sb.append((i + 1)).append(". ").append(tasks.get(i)).append("\n");
6466
}
6567
return sb.toString().trim();
6668
}
6769

6870
public static String getInvalidTaskNumberMessage() {
69-
return "Invalid task number!";
71+
return "Invalid task number! Did you mistake a shadow for a task?";
7072
}
7173

7274
public static String getInvalidCommandMessage() {
73-
return "Invalid command!";
75+
return "Hiss! I don't understand that command. Please try a valid one.";
7476
}
7577

7678
public static String printBye() {
77-
return "Bye! I'll miss you";
79+
return "Bye! I'll be purring until we meet again.";
7880
}
7981

8082
public static String getTodoUsageMessage() {
81-
return "Please use the correct format for a ToDo:\n"
82-
+ " todo <description>";
83+
return """
84+
To create a ToDo, use the format:
85+
todo <description>
86+
Don't leave out the purr-scription!""";
8387
}
8488

8589
public static String getDeadlineUsageMessage() {
86-
return "Please use the correct format for a Deadline:\n"
87-
+ " deadline <description> /by <deadline info>";
90+
return """
91+
For a Deadline, please use the format:
92+
deadline <description> /by <deadline info>
93+
Don't let your tasks slip through your paws!""";
8894
}
8995

9096
public static String getEventUsageMessage() {
91-
return "Please use the correct format for an Event:\n"
92-
+ " event <description> /from <start> /to <end>";
97+
return """
98+
For an Event, please use the format:
99+
event <description> /from <start> /to <end>
100+
Time to mark your calendars and chase the fun!""";
93101
}
94102

95103
}

0 commit comments

Comments
 (0)