Writing an algorithm as a flowchart from a problem

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

Writing an algorithm as a flowchart from a problem

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A problem says: 'Ask for a password and check it is correct.' Which symbol should the check use?
A A process rectangle with one arrow out
B A decision diamond with a Yes branch and a No branch
2. Which flowchart symbol should show 'INPUT Mark'?
A Parallelogram (input/output)
B Rectangle (process)
3. Which shows a correct decision for the problem 'Is the temperature over 30?'
A Diamond containing Temp > 30, with arrows labelled Yes and No
B Diamond containing Temp > 30, with two unlabelled arrows
4. When you build a flowchart from a problem, how many Start symbols does it need?
A One Start for each decision
B One Start terminator at the top
5. A flowchart has a decision with a Yes path that reaches Stop, but the No path just ends in mid-air. What is wrong?
A The No path does not reach Stop, so the flowchart is incomplete
B Nothing, because only the Yes path needs to reach Stop

Match the Pairs

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

Left columnRight column
1Diamond labelled Yes / No: Is Mark >= 50? AA decision symbol with two labelled exits, so the flowchart can follow either path depending on the data
2Parallelogram: INPUT Mark BYes branch: OUTPUT "Pass" → Stop; No branch: OUTPUT "Fail" → Stop
3Every path through the flowchart must reach a Stop symbol CThe decision has only one labelled exit, so the No path is missing and the flowchart cannot finish for some data
4Check the flowchart with test data such as 50 and 49 to follow each path DTest Mark = 50 → Yes → Pass; Test Mark = 49 → No → Fail
5Diamond with one Yes exit and no No exit EAn input symbol that reads a value from the user into the variable Mark
6Rectangle: INPUT Mark FInput drawn in a process rectangle instead of a parallelogram

Definitions

flowchart

Fill in the Blanks

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

1.
Parallelogram: _____ Mark Diamond: Mark >= 50?
2.
Diamond: Mark >= 50? ___ arrow: OUTPUT "Pass" No arrow: OUTPUT "Fail"
3.
OUTPUT "Pass" -> ____ OUTPUT "Fail" -> Stop
4.
Rectangle: Total _ Total + Mark
5.
Test data: Mark = 50, expect Pass Diamond: Mark __ 50? Yes -> OUTPUT "Pass" -> Stop

Spot the Error

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

Question 1
A (START)
B /INPUT Mark/
C <Mark >= 50?>
D Yes -> [OUTPUT "Pass"]
E No -> /OUTPUT "Fail"/
F (STOP)
Question 2
A (START)
B /INPUT Temp/
C <Temp > 30?>
D -> /OUTPUT "Hot"/
E No -> /OUTPUT "OK"/
F (STOP)
Question 3
A (START)
B /INPUT Price/
C [Total ← Price * Qty]
D /OUTPUT Total/
E (STOP)
Question 4
A (START)
B [Total = 0]
C /INPUT Mark/
D [Total ← Total + Mark]
E /OUTPUT Total/
F (STOP)
Question 5
A [START]
B /INPUT Num/
C [Square ← Num * Num]
D /OUTPUT Square/
E (STOP)

Answer Key

Writing an algorithm as a flowchart from a problem
Section A: Quick Questions
Q1
B — A decision diamond with a Yes branch and a No branch
Q2
A — Parallelogram (input/output)
Q3
A — Diamond containing Temp > 30, with arrows labelled Yes and No
Q4
B — One Start terminator at the top
Q5
A — The No path does not reach Stop, so the flowchart is incomplete
Section B: Match the Pairs
Q1
Diamond labelled Yes / No: Is Mark >= 50? → A decision symbol with two labelled exits, so the flowchart can follow either path depending on the data
Q2
Parallelogram: INPUT Mark → An input symbol that reads a value from the user into the variable Mark
Q3
Every path through the flowchart must reach a Stop symbol → Yes branch: OUTPUT "Pass" → Stop; No branch: OUTPUT "Fail" → Stop
Q4
Check the flowchart with test data such as 50 and 49 to follow each path → Test Mark = 50 → Yes → Pass; Test Mark = 49 → No → Fail
Q5
Diamond with one Yes exit and no No exit → The decision has only one labelled exit, so the No path is missing and the flowchart cannot finish for some data
Q6
Rectangle: INPUT Mark → Input drawn in a process rectangle instead of a parallelogram
Section C: Definitions
Q1
flowchart — A diagram that solves a problem using symbols for start, input, process, decision, output and stop, joined by arrows. Label each decision Yes or No and test every path to Stop.
Section D: Fill in the Blanks
Q1
Parallelogram: INPUT Mark Diamond: Mark >= 50?
Q2
Diamond: Mark >= 50? Yes arrow: OUTPUT "Pass" No arrow: OUTPUT "Fail"
Q3
OUTPUT "Pass" -> Stop OUTPUT "Fail" -> Stop
Q4
Rectangle: Total ← Total + Mark
Q5
Test data: Mark = 50, expect Pass Diamond: Mark >= 50? Yes -> OUTPUT "Pass" -> Stop
Section E: Spot the Error
Q1
D — OUTPUT must be drawn in a parallelogram (shown here as / /), not a process rectangle [ ]. It should be Yes -> /OUTPUT "Pass"/.
Q2
D — Every arrow leaving a decision must be labelled Yes or No. The line should start Yes -> so the path is clear.
Q3
B — Qty is used in the process but never input, so Total cannot be worked out. The input should be /INPUT Price, Qty/.
Q4
B — A process symbol sets a value using the assignment arrow ←, not =. It should be [Total ← 0].
Q5
A — START must be drawn in a terminator (rounded) symbol, not a process rectangle. It should be (START).