From 61f032be67ff9d2eef60d949a0bdbb28371db2b4 Mon Sep 17 00:00:00 2001 From: tayponghee Date: Sat, 3 Feb 2024 22:18:52 +0800 Subject: [PATCH] Clean up contact0 --- cs2113 (week 3 contacts).iml | 11 +++++++++++ src/main/java/Contacts0.java | 19 +++++++++++++------ textui-test/EXPECTED.TXT | 2 +- 3 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 cs2113 (week 3 contacts).iml diff --git a/cs2113 (week 3 contacts).iml b/cs2113 (week 3 contacts).iml new file mode 100644 index 0000000..f76df2b --- /dev/null +++ b/cs2113 (week 3 contacts).iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/Contacts0.java b/src/main/java/Contacts0.java index e23d58a..e93b091 100644 --- a/src/main/java/Contacts0.java +++ b/src/main/java/Contacts0.java @@ -3,14 +3,13 @@ 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: "); @@ -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]