Writing an Algorithm Down: Flowcharts and Pseudocode · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.

Plan it on paper first

Computing · Computing Fundamentals · ages 13-14
Name ______________________   Date ____________
  1. Which line takes a typed number into the plan?

    • SET total to 0
    • ASK for input
    • PRINT the total
  2. What is pseudocode?

    • Real code written in Python
    • A strict secret language
    • The plan before the code
  3. In a flowchart, a diamond shape holds a decision.

    Circle one:   True   False

  4. A flowchart asks for a password, tests it in a diamond, loops back on no, and prints welcome on yes. Which pseudocode agrees step for step?

    • ASK, WHILE wrong repeat ASK, PRINT welcome
    • ASK once, PRINT welcome, then stop
    • ASK password, IF wrong PRINT welcome, then stop
  5. The password plan must keep asking while the guess is wrong. Which word starts that repeat?

    • WHILE
    • PRINT
    • END
  6. Walking pseudocode with a test value is pointless because paper cannot run.

    Circle one:   True   False

  7. Your plan must print even or odd for a typed number. Which shape tests the number?

    • An oval
    • A rectangle
    • A diamond
  8. This password plan loops forever: ASK password, WHILE wrong PRINT try again, PRINT welcome. What is missing?

    • The PRINT welcome line
    • ASK again in the loop
    • The WHILE word itself
LightMySky · lightmysky.comW1-mt_RCm-4b4Lof-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

Plan it on paper first W1-mt_RCm-4b4Lof-s1

  1. ASK for input · ASK takes input, SET stores, and PRINT shows output.
  2. The plan before the code · Pseudocode plans logic in clear English before real code exists.
  3. True · Diamonds ask questions with yes and no arrows out.
  4. ASK, WHILE wrong repeat ASK, PRINT welcome · Only the loop version repeats the ask and ends with welcome.
  5. WHILE · WHILE repeats lines until its test turns false.
  6. False · Acting out each line with a value exposes flaws before coding.
  7. A diamond · Even or odd is a question with two exits, which is a diamond.
  8. ASK again in the loop · Nothing asks again inside the loop, so the guess never changes.
Worksheet · LightMySky