Spot and Remove an Unreachable Branch
Scenario
A course attendance checker starts with attendance < 75 -> Yes: Not Eligible. On the No branch, an author accidentally added a second diamond: attendance < 60 -> Yes: Warning, No: Eligible.
Try it yourself
Try to pick a number for attendance that reaches the Warning output.
| Case | Result |
|---|---|
| attendance = 55 | Select a choice above to see what happens. |
| attendance = 75 | Select a choice above to see what happens. |
| attendance = 68 | Select a choice above to see what happens. |
Reveal the explanation
- attendance = 55
Not Eligible
- attendance = 75
Eligible
- attendance = 68
Not Eligible
Comparing the original flowchart with the simplified two-outcome version shows identical outputs for every possible input. Removing dead branches makes flowcharts cleaner and prevents false assumptions about how Warning works.
Download shared test cases
Your turn
Inspect an event waitlist flowchart: Diamond 1 checks seatsLeft == 0 -> Yes: Waitlist. Its No arrow goes to Diamond 2: seatsLeft <= 0 -> Yes: Waitlist, No: Reserve Seat. Assuming seatsLeft >= 0, simplify the flowchart.
Common mistake Deleting Diamond 1 instead of Diamond 2, or forgetting to test seatsLeft = 0 and seatsLeft = 1 after simplifying.
Check your work
One diamond (seatsLeft == 0) with Yes -> Waitlist and No -> Reserve Seat, producing the exact same result for seatsLeft = 0, 1, and 5.
Quick check
This browser could not save your progress. Changes last until you leave the page.