diff --git a/AliceAndBobEngine.java b/AliceAndBobEngine.java index 28b5e05..c2d3230 100644 --- a/AliceAndBobEngine.java +++ b/AliceAndBobEngine.java @@ -10,8 +10,11 @@ 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 +22,11 @@ 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 +34,11 @@ 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 +51,13 @@ public Boolean isAliceOrBob(String input) { * @return respective String value */ public String getGreeting(String input) { - return null; + if (input == "Alice"){ + return "Hello Alice"; + } else if (input == "Bob"){ + return "Hello Bob"; + } else { + return "Begone, input!You're a stranger!"; } } +}; + diff --git a/package.bluej b/package.bluej index 143e572..037d7e4 100644 --- a/package.bluej +++ b/package.bluej @@ -1,20 +1,32 @@ #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 -objectbench.width=776 +dependency1.from=IsBobTest +dependency1.to=AliceAndBobEngine +dependency1.type=UsesDependency +dependency2.from=IsAliceOrBobTest +dependency2.to=AliceAndBobEngine +dependency2.type=UsesDependency +dependency3.from=GetGreetingTest +dependency3.to=AliceAndBobEngine +dependency3.type=UsesDependency +dependency4.from=IsAliceTest +dependency4.to=AliceAndBobEngine +dependency4.type=UsesDependency +editor.fx.0.height=722 +editor.fx.0.width=800 +editor.fx.0.x=240 +editor.fx.0.y=26 +objectbench.height=145 +objectbench.width=1256 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.frame.height=600 -package.frame.width=800 -package.numDependencies=0 -package.numTargets=1 +package.divider.vertical=0.7738095238095238 +package.editor.height=513 +package.editor.width=1162 +package.editor.x=0 +package.editor.y=23 +package.frame.height=730 +package.frame.width=1280 +package.numDependencies=4 +package.numTargets=5 package.showExtends=true package.showUses=true project.charset=UTF-8 @@ -24,9 +36,37 @@ readme.width=47 readme.x=10 readme.y=10 target1.height=50 -target1.name=Main +target1.name=IsAliceTest target1.showInterface=false -target1.type=ClassTarget -target1.width=80 -target1.x=70 +target1.type=UnitTestTargetJunit4 +target1.width=90 +target1.x=140 target1.y=10 +target2.height=50 +target2.name=IsBobTest +target2.showInterface=false +target2.type=UnitTestTargetJunit4 +target2.width=80 +target2.x=70 +target2.y=70 +target3.height=50 +target3.name=IsAliceOrBobTest +target3.showInterface=false +target3.type=UnitTestTargetJunit4 +target3.width=120 +target3.x=160 +target3.y=70 +target4.height=50 +target4.name=AliceAndBobEngine +target4.showInterface=false +target4.type=ClassTarget +target4.width=130 +target4.x=10 +target4.y=130 +target5.height=50 +target5.name=GetGreetingTest +target5.showInterface=false +target5.type=UnitTestTargetJunit4 +target5.width=120 +target5.x=150 +target5.y=130