Skip to content

Edited code and passed all tests #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions AliceAndBobEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ public class AliceAndBobEngine {
* @return `true` if `input` is "Alice"
*/
public Boolean isAlice(String input) {
return null;
return input.equals("Alice");
}


/**
* return `true` if the input value is "Bob"
* @param input - this value is variable: it has the potential to be many things
* @return `true` if `input` is "Bob"
*/
public Boolean isBob(String input) {
return null;
return input.equals("Bob");
}

/**
Expand All @@ -28,7 +29,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;
}
}

/**
Expand All @@ -42,6 +47,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!";
}
}
}
1 change: 0 additions & 1 deletion IsAliceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ private void testIsAlice(String input, Boolean expected){
// when
Boolean actual = evaluator.isAlice(input);


// then
Assert.assertEquals(expected, actual);
}
Expand Down
1 change: 0 additions & 1 deletion IsBobTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ private void testIsBob(String input, Boolean expected) {
// when
Boolean actual = evaluator.isBob(input);


// then
Assert.assertEquals(expected, actual);
}
Expand Down
Empty file added README.TXT
Empty file.
84 changes: 65 additions & 19 deletions package.bluej
Original file line number Diff line number Diff line change
@@ -1,32 +1,78 @@
#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
package.divider.horizontal=0.6
package.divider.vertical=0.8007380073800738
package.editor.height=427
package.editor.width=674
dependency1.from=IsAliceOrBobTest
dependency1.to=AliceAndBobEngine
dependency1.type=UsesDependency
dependency2.from=GetGreetingTest
dependency2.to=AliceAndBobEngine
dependency2.type=UsesDependency
dependency3.from=IsAliceTest
dependency3.to=AliceAndBobEngine
dependency3.type=UsesDependency
dependency4.from=IsBobTest
dependency4.to=AliceAndBobEngine
dependency4.type=UsesDependency
editor.fx.0.height=706
editor.fx.0.width=800
editor.fx.0.x=385
editor.fx.0.y=25
objectbench.height=164
objectbench.width=431
package.divider.horizontal=0.5615384615384615
package.divider.vertical=0.6809701492537313
package.editor.height=358
package.editor.width=667
package.editor.x=181
package.editor.y=109
package.frame.height=600
package.frame.width=800
package.numDependencies=0
package.numTargets=1
package.numDependencies=4
package.numTargets=6
package.showExtends=true
package.showUses=true
project.charset=UTF-8
readme.height=58
readme.height=60
readme.name=@README
readme.width=47
readme.width=48
readme.x=10
readme.y=10
target1.height=50
target1.name=Main
target1.height=70
target1.name=IsAliceTest
target1.showInterface=false
target1.type=ClassTarget
target1.width=80
target1.x=70
target1.y=10
target1.width=120
target1.x=10
target1.y=130
target2.height=70
target2.name=IsBobTest
target2.showInterface=false
target2.type=ClassTarget
target2.width=120
target2.x=140
target2.y=120
target3.height=70
target3.name=IsAliceOrBobTest
target3.showInterface=false
target3.type=ClassTarget
target3.width=120
target3.x=140
target3.y=260
target4.height=70
target4.name=AliceAndBobEngine
target4.showInterface=false
target4.type=ClassTarget
target4.width=140
target4.x=300
target4.y=190
target5.height=70
target5.name=README.md
target5.type=TextTarget
target5.width=120
target5.x=140
target5.y=10
target6.height=70
target6.name=GetGreetingTest
target6.showInterface=false
target6.type=ClassTarget
target6.width=120
target6.x=10
target6.y=250