From 884e46de7013b907f728245e1647d3a00cf32823 Mon Sep 17 00:00:00 2001 From: Mike Nishizawa Date: Wed, 9 Mar 2016 19:59:18 -0500 Subject: [PATCH 1/5] changed it back to world from mike --- src/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 90457ba..a0428da 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,6 +1,6 @@ public class Main { public static void main(String[] args) { - System.out.println("Hello Mike!"); + System.out.println("Hello World!"); } } From ad5fead0f3411aa8b49fc399cae23e9267d95c01 Mon Sep 17 00:00:00 2001 From: Mike Nishizawa Date: Wed, 9 Mar 2016 20:00:33 -0500 Subject: [PATCH 2/5] step 1 --- src/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index a0428da..90457ba 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,6 +1,6 @@ public class Main { public static void main(String[] args) { - System.out.println("Hello World!"); + System.out.println("Hello Mike!"); } } From 0a5035210611cfac5e36404a91d635432d1149ac Mon Sep 17 00:00:00 2001 From: Mike Nishizawa Date: Wed, 9 Mar 2016 20:01:25 -0500 Subject: [PATCH 3/5] step 2 --- src/Main.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 90457ba..f020bba 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,6 +1,6 @@ public class Main { public static void main(String[] args) { - System.out.println("Hello Mike!"); + System.out.println("Hello "+args[0]+"!"); } } From 4914fc3e5e2c730d1cfedfa0611e7ffa3edc9dc7 Mon Sep 17 00:00:00 2001 From: Mike Nishizawa Date: Wed, 9 Mar 2016 20:02:32 -0500 Subject: [PATCH 4/5] step 3 --- src/Main.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index f020bba..8a2dc7f 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,6 +1,8 @@ public class Main { public static void main(String[] args) { - System.out.println("Hello "+args[0]+"!"); + for (int i = 0; i < 20; i++) { + System.out.println("Hello " + args[0] + "!"); + } } } From b616162c0ff661cfc4f998a1034275dc7953ddf6 Mon Sep 17 00:00:00 2001 From: Mike Nishizawa Date: Wed, 9 Mar 2016 20:15:26 -0500 Subject: [PATCH 5/5] step 4 --- src/Main.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 8a2dc7f..dfce23f 100644 --- a/src/Main.java +++ b/src/Main.java @@ -2,7 +2,15 @@ public class Main { public static void main(String[] args) { for (int i = 0; i < 20; i++) { - System.out.println("Hello " + args[0] + "!"); + System.out.println(pad(i+1, 2)+") Hello " + args[0] + "!"); } } + + private static String pad(int number, int places) { + if(String.valueOf(number).length() < places) { + return String.format("%0"+places+"d", number); + } + + return String.valueOf(number); + } }