File tree Expand file tree Collapse file tree
src/main/java/org/teachingkidsprogramming Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" )
2020public 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 }
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments