Skip to content

Lab completed #29

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
16 changes: 11 additions & 5 deletions AliceAndBobEngine.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

/**
* Write a description of class AliceAndBobEngine here.
* It is creating a greeting. If the person is Bob or Alice it will greet them
* by name. Otherwise the result will be scared.
*
* @author (your name)
* @version (a version number or a date)
* @author Gregory Donnelly
* @version 2.24.2021
*/
public class AliceAndBobEngine
{
Expand All @@ -16,7 +16,13 @@ public class AliceAndBobEngine
//HINT: LOOK AT THE TESTS TO SEE WHAT IS EXPECTED FOR DIFFERENT CONDITIONS
public String evaluateAliceOrBob(String input)
{

if (input.equals("Alice")) {
result = "Hello Alice";
} else if (input.equals("Bob")) {
result = "Hello Bob";
} else {
result = "I DON'T KNOW YOU, YOU ARE SCARY";
}
return result;
}
}
4 changes: 2 additions & 2 deletions AliceAndBobEngineTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
/**
* The test class AliceAndBobEngineTest.
*
* @author (your name)
* @version (a version number or a date)
* @author Gregory Donnelly
* @version 2.24.2021
*/
public class AliceAndBobEngineTest
{
Expand Down
38 changes: 24 additions & 14 deletions package.bluej
Original file line number Diff line number Diff line change
@@ -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
dependency1.from=AliceAndBobEngineTest
dependency1.to=AliceAndBobEngine
dependency1.type=UsesDependency
editor.fx.0.height=722
editor.fx.0.width=800
editor.fx.0.x=169
editor.fx.0.y=23
objectbench.height=101
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.editor.width=682
package.editor.x=1526
package.editor.y=44
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
Expand All @@ -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.x=70
target1.y=10
target1.type=UnitTestTargetJunit4
target1.width=160
target1.x=160
target1.y=20
target2.height=50
target2.name=AliceAndBobEngine
target2.showInterface=false
target2.type=ClassTarget
target2.width=130
target2.x=210
target2.y=130