From 198474e89adbcbcbb6bd44e7bd17171242393a9d Mon Sep 17 00:00:00 2001 From: smartist17 <79124739+smartist17@users.noreply.github.com> Date: Fri, 26 Feb 2021 17:17:32 -0500 Subject: [PATCH] Alice and bob fix --- AliceAndBobEngine.java | 19 +++++++++++++++++-- package.bluej | 42 ++++++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/AliceAndBobEngine.java b/AliceAndBobEngine.java index 0c0006e..3bd5858 100644 --- a/AliceAndBobEngine.java +++ b/AliceAndBobEngine.java @@ -10,13 +10,28 @@ public class AliceAndBobEngine String result; AliceAndBobEngine(){ - result = ""; + result = ""; + + + } //HINT: LOOK AT THE TESTS TO SEE WHAT IS EXPECTED FOR DIFFERENT CONDITIONS public String evaluateAliceOrBob(String input) { - + if (input == "Alice"){ + result = "Hello Alice"; + } + else if (input == "Bob") + + result = "Hello Bob"; + else { + + result = "I DON'T KNOW YOU, YOU ARE SCARY"; + } + + + return result; } } diff --git a/package.bluej b/package.bluej index 143e572..f7b43a6 100644 --- a/package.bluej +++ b/package.bluej @@ -1,20 +1,23 @@ #BlueJ package file -editor.fx.0.height=0 -editor.fx.0.width=0 -editor.fx.0.x=0 -editor.fx.0.y=0 -objectbench.height=101 +dependency1.from=AliceAndBobEngineTest +dependency1.to=AliceAndBobEngine +dependency1.type=UsesDependency +editor.fx.0.height=660 +editor.fx.0.width=793 +editor.fx.0.x=286 +editor.fx.0.y=23 +objectbench.height=90 objectbench.width=776 package.divider.horizontal=0.6 -package.divider.vertical=0.8007380073800738 -package.editor.height=427 -package.editor.width=674 -package.editor.x=181 -package.editor.y=109 +package.divider.vertical=0.8210332103321033 +package.editor.height=438 +package.editor.width=682 +package.editor.x=781 +package.editor.y=54 package.frame.height=600 package.frame.width=800 -package.numDependencies=0 -package.numTargets=1 +package.numDependencies=1 +package.numTargets=2 package.showExtends=true package.showUses=true project.charset=UTF-8 @@ -24,9 +27,16 @@ readme.width=47 readme.x=10 readme.y=10 target1.height=50 -target1.name=Main +target1.name=AliceAndBobEngineTest target1.showInterface=false -target1.type=ClassTarget -target1.width=80 +target1.type=UnitTestTargetJunit4 +target1.width=160 target1.x=70 -target1.y=10 +target1.y=60 +target2.height=50 +target2.name=AliceAndBobEngine +target2.showInterface=false +target2.type=ClassTarget +target2.width=130 +target2.x=10 +target2.y=120