From a53fa91cbd4484b35e448735e0c7dd6f9911c9ed Mon Sep 17 00:00:00 2001 From: Quatrani Paul Date: Fri, 29 Oct 2021 23:12:41 -0400 Subject: [PATCH] I have added changes --- AliceAndBobEngine.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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; } }