Skip to the content
Peabody TeachFor teachers and grown-ups

Variables, Loops and Bugs: teacher key

How Coding Works, grade 4 edition, written for 4th grade. Learn the building blocks programmers use: instructions, loops, variables, choices, functions and lists. Then see how bugs are hunted down.

Read the book. Print this page for the key.

Questions and answers

  1. What can a loop do?
    • Repeat a set number of times, or until something happens (answer)
    • Turn a bug into an insect
    • Name a variable
  2. What does a variable hold?
    • A bug
    • A value that can change (answer)
    • A recipe
  3. Which is a syntax bug?
    • A typing mistake in the code (answer)
    • A real insect
    • A new game
  4. Why does a computer need a programmer's instructions?
    • It likes lists
    • It cannot think for itself (answer)
    • It is made of bugs
  5. A program takes an umbrella only if it is raining. What is that?
    • A loop
    • A list
    • A conditional (answer)

Words

  • algorithm: list of steps
  • loop: a repeat
  • variable: changing box
  • conditional: if test
  • function: named code
  • debugging: fixing mistakes