Drawing a loop inside a decision in a flowchart

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Drawing a loop inside a decision in a flowchart

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A loop is drawn on the Yes arrow of a decision diamond. When does the loop run?
A Every time the flowchart runs, whatever the answer
B Only when the answer to the decision is Yes
2. What happens on the No path when the loop is drawn on the Yes path?
A The loop is skipped and the flow carries on past it
B The loop runs once and then the flow carries on
3. Where should the exit arrow of the loop go when the loop finishes?
A It rejoins the main flow after the decision
B It goes back up to Start
4. Which flowchart shows a loop that is skipped when the answer is No?
A The No arrow leads into the first box of the loop
B The No arrow leads past the loop to the next step
5. A student draws the loop first and puts the decision diamond inside it. Is this a loop on the Yes path of a decision?
A No, that is a decision inside a loop
B Yes, it is the same thing

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Decision: Is it raining? Yes -> Loop: Is every window closed? No -> Close a window -> back to loop question AThe loop is drawn on the No path, but it should be on the Yes path. Closing windows would happen when it is NOT raining.
2Decision: Is it raining? No -> arrow goes straight to Show 'Done' BLoop question: Is every window closed? Yes -> Show 'Done' (same step the No path goes to)
3The loop exit arrow rejoins the main flow so the Yes and No paths meet again at the same step. CIs the bin full? Yes -> Is the bin empty yet? No -> Take out one item -> back to question
4The loop is only entered when the decision gives Yes, so its first step is drawn on the Yes arrow. DA loop sits on the Yes path. It only runs when it is raining, and it repeats until every window is closed.
5Decision: Is it raining? No -> Loop: Close a window until all are closed EThe No path skips the loop completely and carries on with the main flow.
6Is it raining? Yes -> Loop: Close a window -> Is every window closed? Yes -> end of flowchart (No path never reaches Show 'Done') FThe loop exit arrow does not rejoin the main flow, so the flowchart stops and the next step is never reached.

Definitions

Loop on the Yes path

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
IF score > 10 THEN ______ 3 TIMES OUTPUT "Well done"
2.
IF lights = "off" THEN REPEAT _____ lights = "on" FLICK switch
3.
END REPEAT END __ OUTPUT "Goodbye"
4.
IF answer = "Yes" THEN REPEAT UNTIL _____ = 5 count ← count + 1
5.
IF mark __ 50 THEN REPEAT 2 TIMES OUTPUT "Pass"

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A Start -> Step: Any dishes?
B Yes -> Step: Wash a dish
C Then -> Diamond: More dishes?
D Yes -> back to Wash a dish
E More dishes? No -> Dry up
F Any dishes? No -> Dry up
Question 2
A Start -> Diamond: Homework?
B Yes -> Step: Do a question
C Start -> Diamond: Any left?
D Yes -> back to Do a question
E Any left? No -> Pack bag
F Homework? No -> Pack bag
Question 3
A Start -> Diamond: Monday?
B No -> Step: Water a plant
C Then -> Diamond: More plants?
D Yes -> back to Water a plant
E More plants? No -> Go inside
F Monday? No -> Go inside
Question 4
A Start -> Diamond: Bin full?
B Yes -> Step: Empty the bin
C Bin full? No -> Empty the bin
D Empty it -> Diamond: Another?
E Yes -> back to Empty the bin
F Another? No -> Wash hands
Question 5
A Start -> Diamond: Raining?
B Yes -> Step: Shut a window
C Then -> Diamond: More windows?
D Yes -> back to Raining?
E More windows? No -> Go to bed
F Raining? No -> Go to bed

Answer Key

Drawing a loop inside a decision in a flowchart
Section A: Quick Questions
Q1
B — Only when the answer to the decision is Yes
Q2
A — The loop is skipped and the flow carries on past it
Q3
A — It rejoins the main flow after the decision
Q4
B — The No arrow leads past the loop to the next step
Q5
A — No, that is a decision inside a loop
Section B: Match the Pairs
Q1
Decision: Is it raining? Yes -> Loop: Is every window closed? No -> Close a window -> back to loop question → A loop sits on the Yes path. It only runs when it is raining, and it repeats until every window is closed.
Q2
Decision: Is it raining? No -> arrow goes straight to Show 'Done' → The No path skips the loop completely and carries on with the main flow.
Q3
The loop exit arrow rejoins the main flow so the Yes and No paths meet again at the same step. → Loop question: Is every window closed? Yes -> Show 'Done' (same step the No path goes to)
Q4
The loop is only entered when the decision gives Yes, so its first step is drawn on the Yes arrow. → Is the bin full? Yes -> Is the bin empty yet? No -> Take out one item -> back to question
Q5
Decision: Is it raining? No -> Loop: Close a window until all are closed → The loop is drawn on the No path, but it should be on the Yes path. Closing windows would happen when it is NOT raining.
Q6
Is it raining? Yes -> Loop: Close a window -> Is every window closed? Yes -> end of flowchart (No path never reaches Show 'Done') → The loop exit arrow does not rejoin the main flow, so the flowchart stops and the next step is never reached.
Section C: Definitions
Q1
Loop on the Yes path — A loop drawn on the Yes arrow of a decision diamond. It only runs if Yes is taken. The No path skips it. When the loop ends, its exit arrow rejoins the main flow.
Section D: Fill in the Blanks
Q1
IF score > 10 THEN REPEAT 3 TIMES OUTPUT "Well done"
Q2
IF lights = "off" THEN REPEAT UNTIL lights = "on" FLICK switch
Q3
END REPEAT END IF OUTPUT "Goodbye"
Q4
IF answer = "Yes" THEN REPEAT UNTIL count = 5 count ← count + 1
Q5
IF mark >= 50 THEN REPEAT 2 TIMES OUTPUT "Pass"
Section E: Spot the Error
Q1
A — A question with Yes and No answers must be drawn in a decision diamond, not a step box. It should be 'Start -> Diamond: Any dishes?'.
Q2
C — The loop's check must come after the step on the Yes path ('Then -> Diamond: Any left?'). It cannot start straight from Start, because the loop is only reached through the Yes arrow.
Q3
B — The loop belongs on the Yes path, so it only runs when it is Monday. Line 2 should start with 'Yes ->'. Putting it on No would run the loop on the wrong days.
Q4
C — The No path must skip the loop and go straight to the step after it. Line 3 should be 'Bin full? No -> Wash hands'. Sending No into the loop means the loop runs even when the bin isn't full.
Q5
D — The loop arrow must return to the loop's own step, 'Shut a window'. Going back to the 'Raining?' diamond asks the first decision again instead of repeating the loop.