Chapter 7 · SimulationDecision Tracer? ← Chapter 7Java codeFlowchartOutput (console)Variables CloseDecision TracerPurpose: see which branch of a conditional is chosen, and why. Each condition is shown in three steps: the expression → with the values substituted → true / false. The path taken is highlighted in both the code and the flowchart.How to use itPick a program on the left and change the input variables (for example try the boundary values score = 59, 60, 61).Move on with Step ▶ / ◀ Back (keyboard → / ←), Play and Reset. The arrows and boxes the flow passes through are coloured in the flowchart.In conditions with logical operators, the small boxes below show the value of each part; the dashed, struck-through boxes are parts that were never evaluated because of short-circuiting.Try it yourself: predict the result of each condition and which case a switch jumps to.RemindersIn an else-if chain at most one branch runs; independent ifs are each tested separately.Dangling else: an else binds to the nearest unmatched if, not to the indentation. Curly braces remove the ambiguity.&& does not evaluate the right side when the left is false, and || does not when the left is true (short-circuit). & and | always evaluate both sides.In a classic switch, without break the code of the next case runs too (fall-through). The arrow form (->) has no fall-through (Java 14+).The output of every program was checked against real Java (JDK 21) output for every parameter combination.Related slides: Chapter 7 · Conditionals (if-else, else-if, nested decisions, dangling else, logical operators, switch).