From 264344969f27fc50a38fce4f189d9bae637eda77 Mon Sep 17 00:00:00 2001 From: Zachary Kitto Date: Thu, 24 Jun 2021 22:32:10 -0400 Subject: [PATCH] Everything is passing the tests --- AliceAndBobEngine.java | 24 ++++++++++++++++++++---- IsAliceOrBobTest.java | 4 ++++ 2 files changed, 24 insertions(+), 4 deletions(-) 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() { } } + + } + +