diff --git a/AliceAndBobEngine.java b/AliceAndBobEngine.java index 28b5e05..ec8201d 100644 --- a/AliceAndBobEngine.java +++ b/AliceAndBobEngine.java @@ -10,8 +10,12 @@ public class AliceAndBobEngine { * @return `true` if `input` is "Alice" */ public Boolean isAlice(String input) { - return null; + if (input == "Alice") { + return true; + } else { + return false; } +} /** * return `true` if the input value is "Bob" @@ -19,8 +23,12 @@ public Boolean isAlice(String input) { * @return `true` if `input` is "Bob" */ public Boolean isBob(String input) { - return null; + if (input == "Bob") { + return true; + } else { + return false; } +} /** * return `true` if the input value is "Alice" or "Bob" @@ -28,8 +36,12 @@ public Boolean isBob(String input) { * @return `true` if `input` is "Alice" or "Bob" */ public Boolean isAliceOrBob(String input) { - return null; + if (input == "Alice" || input == "Bob") { + return true; + } else { + return false; } +} /** * if the input value is "Alice" or "Bob", then @@ -42,6 +54,10 @@ public Boolean isAliceOrBob(String input) { * @return respective String value */ public String getGreeting(String input) { - return null; + if (input == "Alice" || input == "Bob") { + return "Hello, " + input + "!"; + } else { + return "Begone, " + input + "! You're a stranger!"; + } } } diff --git a/IsAliceOrBobTest.java b/IsAliceOrBobTest.java index 09be95f..ba8e8f0 100644 --- a/IsAliceOrBobTest.java +++ b/IsAliceOrBobTest.java @@ -34,4 +34,8 @@ public void testIsAliceOrBobFalse() { } } + + } + +