diff --git a/AliceAndBobEngine.java b/AliceAndBobEngine.java index 28b5e05..0d73870 100644 --- a/AliceAndBobEngine.java +++ b/AliceAndBobEngine.java @@ -10,6 +10,9 @@ public class AliceAndBobEngine { * @return `true` if `input` is "Alice" */ public Boolean isAlice(String input) { + if (input != null){ + return input.equals("Alice"); + } return null; } @@ -19,7 +22,10 @@ public Boolean isAlice(String input) { * @return `true` if `input` is "Bob" */ public Boolean isBob(String input) { - return null; + if (input != null){ + return input.equals("Bob"); + } + return null; } /** @@ -28,6 +34,9 @@ public Boolean isBob(String input) { * @return `true` if `input` is "Alice" or "Bob" */ public Boolean isAliceOrBob(String input) { + if (input != null){ + return this.isAlice(input) || this.isBob(input); + } return null; } @@ -42,6 +51,12 @@ public Boolean isAliceOrBob(String input) { * @return respective String value */ public String getGreeting(String input) { + if(input != null){ + if(this.isAliceOrBob(input)){ + return "Hello, " + input + "!"; + } + return "Begone, " + input + "! You're a stranger!"; + } return null; } }