Year 8 · Y8.2 Computational Thinking · Lesson 2

Stretch tasks Flowcharts

Task 1

Quiz Challenge

A quiz game against four computer players, then short and long written answers.

  1. Quiz Blitz12 questions against the clock
  2. Quick Fire4 short answers
  3. Big Think2 long answers

About 20 minutes

Task 2

This or That

Pixel the cat asks 8 questions. Each has two answers: pick the right one.

  • Two answers to every question
  • A fish treat for every right answer
  • Streaks win Pixel shades, then a party hat

About 4 minutes

Task 3

Memory Match

Flip the cards two at a time to match each term card to its meaning card.

  • 12 cards: each term has a meaning
  • One peek at every card
  • Combo points for pairs found in a row

6 pairs, about 4 minutes

The games need JavaScript. Every question is below, with the answers at the end.

Read the lesson: Flowcharts

Flowcharts: the questions

Quiz Challenge, round 1: Quiz Blitz

  1. Which flowchart shape is used for a decision?

    • Rounded rectangle
    • Diamond
    • Rectangle
    • Parallelogram
  2. Which shape would you use for: Input age?

    • Parallelogram
    • Rectangle
    • Diamond
    • Rounded rectangle
  3. A decision diamond can have three exits when there are three possible answers.

    • True
    • False
  4. Put this flowchart for an odd or even checker in order.

    Number these 1 to 5.

    • Is number MOD 2 = 0?
    • Output Even or Odd
    • Stop
    • Start
    • Input number
  5. How is a loop shown in a flowchart?

    • A circle drawn around the repeated steps
    • A rectangle with the word LOOP inside
    • A dotted line along the bottom
    • An arrow going back up to an earlier step
  6. What is output when the score is exactly 50?

    Start
    Input score
    Is score >= 50?
        Yes -> Output "Pass"
        No  -> Output "Fail"
    Stop
    • Pass, then Fail
    • Pass
    • Fail
    • Nothing is output
  7. Trace the flowchart. Type every number it outputs, with spaces between them.

    Start
    count = 1
    Output count            <-+
    count = count + 2         |
    Is count > 7?             |
        No  -> back up -------+
        Yes -> Stop

  8. Start, then Input age, then a diamond asking Is age >= 13? with one unlabelled arrow to Output Allowed, then Stop. What is wrong?

    • Input should be drawn as a rectangle
    • A flowchart needs two Start symbols
    • Output must always come before Input
    • The decision has only one exit, and it is not labelled
  9. Which TWO are rules for drawing flowcharts?

    Tick 2.

    • Every decision has exactly two labelled exits
    • It begins with Start and ends with Stop
    • Every flowchart must contain a loop
    • Arrows can point both ways at once
    • Process boxes must be coloured in
  10. Which shape is used for: total = total + price?

    • Parallelogram
    • Diamond
    • Rounded rectangle
    • Rectangle
  11. A flowchart and a piece of pseudocode can describe exactly the same algorithm.

    • True
    • False
  12. Why do programmers draw flowcharts before writing code?

    • To check the logic of an algorithm before any code is written
    • Computers run flowcharts faster than code
    • A flowchart replaces the need for testing
    • Code will not run without a flowchart

Quiz Challenge, round 2: Quick Fire

  1. Name the flowchart symbol for each step. (a) Output Hello (b) Is x > 10? [2 marks]

  2. Explain why both exits of a decision diamond must be labelled. [2 marks]

  3. A flowchart asks Is password correct? If the answer is No, an arrow goes back to Input password. What does this arrow create, and what is the risk? [2 marks]

  4. Explain the difference between a process box and an input or output box. [2 marks]

Quiz Challenge, round 3: Big Think

  1. Describe a flowchart for an algorithm that asks for a number, then outputs whether it is positive, negative or zero. [4 marks]

  2. Compare flowcharts and pseudocode as ways of planning an algorithm. Which would you use for a long program, and why? [6 marks]

This or That: tick the right answer

  1. Which shape holds Start and Stop?

    • A rounded rectangle
    • A diamond
  2. Which shape is used for Output "Well done"?

    • Rectangle
    • Parallelogram
  3. What must be written on the two arrows that leave a decision?

    • Yes and No
    • Start and Stop
  4. In the flowchart that checks whether a number is even, which test decides the answer?

    • number / 2 = 0
    • number MOD 2 = 0
  5. What is the most common mistake in flowchart questions?

    • Using too many arrows
    • Unlabelled decision branches
  6. A flowchart inputs 7 and asks: Is number MOD 2 = 0? What is output?

    • Even
    • Odd
  7. Which symbol would hold: Is the password correct?

    • Diamond
    • Parallelogram
  8. Where must every flowchart finish?

    • At a Stop terminal
    • At the last decision

Memory Match: match each term to its meaning

TermMeaning
A Rounded rectangle1 A decision with Yes and No exits
B Rectangle2 Start or Stop
C Parallelogram3 A process, such as a calculation
D Diamond4 Shows the direction of flow
E Arrow5 An algorithm drawn as a diagram
F Flowchart6 Input or output
Answers

Round 1: Quiz Blitz

  1. Diamond A diamond asks a question and has exactly two labelled exits, such as Yes and No.
  2. Parallelogram Input and output both use the parallelogram.
  3. False A decision always has exactly two exits. Three outcomes need two decisions, one after the other.
  4. Start → Input number → Is number MOD 2 = 0? → Output Even or Odd → Stop Start, get the data in, decide, show the result, stop. Most flowcharts follow that shape.
  5. An arrow going back up to an earlier step An arrow that returns to an earlier box makes those steps happen again.
  6. Pass >= means greater than or equal to, so 50 passes. Boundary values like this are where bugs hide.
  7. 1 3 5 7 count goes 1, 3, 5, 7. After 7 it becomes 9, which is greater than 7, so the loop stops before 9 is output.
  8. The decision has only one exit, and it is not labelled Every decision needs two labelled exits. Here nobody knows what happens to someone under 13.
  9. Every decision has exactly two labelled exits; It begins with Start and ends with Stop Two labelled exits per decision, and one clear start and stop. Loops are only there when the algorithm needs one.
  10. Rectangle A calculation or action inside the computer is a process, drawn as a rectangle.
  11. True They are two ways of writing down the same steps: one as a diagram, one as structured text.
  12. To check the logic of an algorithm before any code is written A flowchart lets you see and fix the logic while it is still cheap to change.

Round 2: Quick Fire

    • (a) Parallelogram
    • (b) Diamond
    Model answer

    (a) Output uses a parallelogram. (b) A decision uses a diamond.

    • So the reader knows which way is Yes and which is No
    • Otherwise it is unclear and could be followed the wrong way
    Model answer

    Labels show which way is Yes and which is No. Without them the flowchart is ambiguous, and someone could follow the wrong branch and get the wrong result.

    • A loop
    • It could go on forever, giving unlimited guesses
    Model answer

    The arrow creates a loop. The risk is that it could go on forever: with no limit on attempts, someone could keep guessing passwords until they get in.

    • A process is a calculation or action carried out inside the computer
    • Input or output is data coming in from the user, or results shown to them
    Model answer

    A process box is a calculation or action carried out inside the computer, such as adding to a total. An input or output box is data coming in from the user, such as typing a number, or results being displayed on the screen.

Round 3: Big Think

    • Start and Stop in rounded terminal boxes
    • The number is input in a parallelogram
    • A decision diamond, such as Is number > 0?
    • A second decision, because three outcomes need two diamonds
    • Both exits of each decision labelled Yes and No
    • Each result is output in a parallelogram
    Model answer

    The flowchart begins with a Start terminal. A parallelogram inputs the number. A decision diamond asks Is number > 0?; its Yes exit leads to an output parallelogram saying Positive. Its No exit leads to a second decision, because three outcomes need two diamonds: Is number < 0? Its Yes exit outputs Negative and its No exit outputs Zero. Every exit is labelled Yes or No, and all three outputs join and flow to Stop.

    • Flowcharts are visual, so the flow is easy to see
    • Flowcharts are easier for beginners or non-programmers to understand
    • Flowcharts get large and messy for long programs
    • Pseudocode is close to real code, so it is easy to turn into a program
    • Pseudocode is quicker to write and edit, and more compact
    • Pseudocode has no strict syntax, so you can focus on the logic
    • A justified choice for a long program, normally pseudocode
    Model answer

    Flowcharts are visual, so the flow of the algorithm is easy to see, and beginners or people who cannot code find them easy to understand. However, they take up a lot of space and get large and messy for long programs. Pseudocode is written as structured text, so it is compact and quicker to write and edit, and because it is close to real code it is easy to convert into a program. It has no strict syntax, so you can focus on the logic. For a long program I would use pseudocode, because a flowchart of hundreds of steps would cover many pages and be hard to change, whereas pseudocode stays readable and turns straight into code.

This or That

  1. A rounded rectangle Start and Stop go in the terminal shape, a rounded rectangle. A diamond is a decision.
  2. Parallelogram Inputs and outputs use a parallelogram. A rectangle is a process, such as a calculation.
  3. Yes and No Each exit is labelled, so the reader knows which way to go for each answer.
  4. number MOD 2 = 0 MOD gives the remainder. An even number leaves a remainder of 0 when divided by 2.
  5. Unlabelled decision branches Without Yes and No labels, nobody can tell which branch to follow.
  6. Odd 7 MOD 2 is 1, not 0, so the No branch runs and outputs Odd.
  7. Diamond A question with Yes and No answers is a decision, drawn as a diamond.
  8. At a Stop terminal Every flowchart begins with Start and finishes with Stop, both in rounded rectangles.

Memory Match

  • A 2 Rounded rectangle: Start or Stop
  • B 3 Rectangle: A process, such as a calculation
  • C 6 Parallelogram: Input or output
  • D 1 Diamond: A decision with Yes and No exits
  • E 4 Arrow: Shows the direction of flow
  • F 5 Flowchart: An algorithm drawn as a diagram