Skip to content

Commit 591ffd4

Browse files
committed
working on DeepDive09
1 parent 79126cb commit 591ffd4

3 files changed

Lines changed: 6 additions & 257 deletions

File tree

src/main/java/org/teachingkidsprogramming/recipes/completed/section09final/DeepDive09.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// IMPORTANT - Do not change anything except the blank (___)
1414
//
1515
//*****************In Progress************************//
16-
// Looking at using and providing descriptive error messages
17-
// NOTE for Deep Dive Authors: Copy 'answer' to TKPJava answer section when done
16+
// Looking at using and providing descriptive error messages - uses 'Magic Numbers' on purpose to demonstrate how they make code hard to read
17+
// NOTE for Deep Dive Authors: Copy 'answer' to TKPJava course09 section (for students) when done
1818
//
1919
@SuppressWarnings("unused")
2020
public class DeepDive09
@@ -23,15 +23,16 @@ public class DeepDive09
2323
public void exceptionsShouldProvideInformation() throws Exception
2424
{
2525
Chain c = createChain();
26-
int answer = c.get("a").get("b").get("c").get("d").get("e").value;
27-
/* Fix This Line -- must add the string "surprise"*/
26+
int answer = c.get("a").get("b").get(___).get("d").get("e").value;
27+
//the answer is "surprise", but why? be sure to use the debugger to follow the execution path.
2828
Assert.assertEquals(2048, answer);
2929
}
3030
@Test
3131
public void exceptionsShouldExplainPreconditions() throws Exception
3232
{
3333
Game game = new Game();
34-
/* Add needed line here -- game.turnOn();*/
34+
/* Add needed line here -- game.turnOn(); -- need to figure out how to abstract this */
35+
//game.turnOn();
3536
int fun = game.play();
3637
Assert.assertEquals(11, fun);
3738
}

src/main/java/org/teachingkidsprogramming/recipes/inDevelopment/DeepDive09exceptions.java

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/main/java/org/teachingkidsprogramming/section09final/DeepDive09.java

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)