Skip to content
Merged
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions src/main/java/duke/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* user input and outputting to the user.
*/
public class Ui {
private static final String DOTTED_LINE = "____________________________________________________________";

protected final String name;

private final Scanner scanner;
Expand All @@ -25,10 +27,10 @@ public Ui(String name) {
* Initialise UI. Prints banner.
*/
public void init() {
System.out.println("____________________________________________________________");
System.out.println(Ui.DOTTED_LINE);
System.out.printf("Hello! I'm %s\n", this.name);
System.out.println("What can I do for you?");
System.out.println("____________________________________________________________");
System.out.println(Ui.DOTTED_LINE);
}

/**
Expand All @@ -53,9 +55,9 @@ public void printException(Exception e) {
* Prints exit message to user.
*/
public void exit() {
System.out.println("____________________________________________________________");
System.out.println(Ui.DOTTED_LINE);
System.out.println("Bye. Hope to see you again soon!");
System.out.println("____________________________________________________________");
System.out.println(Ui.DOTTED_LINE);
}

/**
Expand Down