diff --git a/src/main/java/Contacts0.java b/src/main/java/Contacts0.java index e23d58a..05b852c 100644 --- a/src/main/java/Contacts0.java +++ b/src/main/java/Contacts0.java @@ -3,17 +3,16 @@ public class Contacts0 { + public static final int MAX_ENTRIES = 100; + 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: "); + String inputLine = SCANNER.nextLine(); while (inputLine.trim().isEmpty() || inputLine.trim().charAt(0) == '#') { inputLine = SCANNER.nextLine(); @@ -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("|| ==================================================="); + } + } \ No newline at end of file diff --git a/textui-test/EXPECTED.TXT b/textui-test/EXPECTED.TXT index 047bf26..7e9849d 100644 --- a/textui-test/EXPECTED.TXT +++ b/textui-test/EXPECTED.TXT @@ -1,6 +1,6 @@ || =================================================== || =================================================== -|| Contacts - Version 0.0 +|| Contacts - Version 1.0 || Welcome to Contacts! || =================================================== || Enter command: || [Command entered:help]