F10 · Topic 3.7
Nested route selector
1. Predict first
If wet then choose Covered ramp when stepFree is true, otherwise Covered stairs; if dry choose Outdoor ramp when stepFree is true, otherwise Outdoor steps. Predict wet=true,stepFree=false.
Change it · step through · explain
Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.
Ready · Make a prediction
- Input 1yesWaiting
- Input 2noWaiting
Ready to experiment
Why: Predict the first change, then advance one step.
Try this: Try all four yes/no combinations. These fictional labels are not accessibility guarantees.
2. Build your procedure
Write the nested conditionals, label the four paths and give one test for each. Explain why testing only wet cases misses half the tree.
Use AP CSP pseudocode, a language you know, or precise plain language. Your code is not executed here. Use the classroom assignment to save your response.
3. Check boundaries
| Input | Expected | Why this case |
|---|---|---|
| wet yes; stepFree no | Covered stairs | Inner false branch inside outer true branch. |
| wet no; stepFree yes | Outdoor ramp | Inner true branch inside outer false branch. |
| wet yes; stepFree yes | Covered ramp | Both conditions true. |
4. Explain and reflect
Why do two separate IF statements not always have the same behaviour as this nested IF/ELSE tree?
Model limits: A fixed fictional decision tree, not live weather, a map or an accessibility guarantee. Real route suitability requires reliable local information.