Skip to content
Open
Show file tree
Hide file tree
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
21 changes: 14 additions & 7 deletions src/main/java/Contacts0.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@

public class Contacts0 {

public static final int MAX_ENTRIES = 100;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good job extracting a constant

public static final String LINE_SEPARATOR = "===================================================";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Why so??


public static void main(String[] args) {
final Scanner SCANNER = new Scanner(System.in);
System.out.println("|| ===================================================");
System.out.println("|| ===================================================");
System.out.println("|| Contacts - Version 0.0");
System.out.println("|| Welcome to Contacts!");
System.out.println("|| ===================================================");
String[][] list = new String[100][3];
printWelcomeMessage();
String[][] list = new String[MAX_ENTRIES][3];
int count = 0;
while (true) {
System.out.print("|| " + "Enter command: ");
Expand Down Expand Up @@ -113,7 +112,7 @@ public static void main(String[] args) {
break;
case "exit":
for (String m1 : new String[]{"Exiting Contacts... Good bye!",
"===================================================",
LINE_SEPARATOR,
"==================================================="}) {
System.out.println("|| " + m1);
}
Expand Down Expand Up @@ -146,4 +145,12 @@ public static void main(String[] args) {
}
}

private static void printWelcomeMessage() {
System.out.println("|| ===================================================");
System.out.println("|| ===================================================");
System.out.println("|| Contacts - Version 1.0");
System.out.println("|| Welcome to Contacts!");
System.out.println("|| ===================================================");
}

}
2 changes: 1 addition & 1 deletion textui-test/EXPECTED.TXT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
|| ===================================================
|| ===================================================
|| Contacts - Version 0.0
|| Contacts - Version 1.0
|| Welcome to Contacts!
|| ===================================================
|| Enter command: || [Command entered:help]
Expand Down