Curriculum

Curriculum

Choose Between Nested Decisions and Combined AND

Scenario

A lab equipment loan desk requires two things: a valid student ID (hasStudentId == true) and zero overdue items (overdueCount == 0). The desk wants to tell students exactly why a request was declined.

Selected choicePick a choice below
Result—

Try it yourself

Predict what happens to the error message when hasStudentId is true and overdueCount is 2 under a single combined AND diamond.

Reveal the explanation
  1. hasStudentId = true, overdueCount = 0

    Approved

  2. hasStudentId = false, overdueCount = 0

    Combined: Declined | Nested: Declined: Missing student ID

  3. hasStudentId = true, overdueCount = 2

    Combined: Declined | Nested: Declined: Return overdue items first

Use combined AND when a simple Yes/No answer is enough. Use nested decisions when users need actionable feedback telling them which specific requirement failed.

Download shared test cases

Your turn

Design a study-room booking check for two rules: groupSize >= 2 and roomIsFree == true. Choose nested or combined AND so the student knows whether to add a teammate or pick another time.

Common mistake Using a combined AND diamond that only outputs Booking Rejected when distinct instructions are required.

Check your work

A nested two-diamond flowchart where groupSize >= 2 failing outputs Need at least 2 students, and roomIsFree == true failing outputs Room already booked.

Quick check

When should you prefer nested decisions over a single combined AND condition?
Show the answer and reasoning

Correct answer When each failed requirement needs its own distinct explanation or action.

Nested decisions separate each rule onto its own No branch, allowing distinct messages for each failure.