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
- 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
- What does a variable hold?
- A bug
- A value that can change (answer)
- A recipe
- Which is a syntax bug?
- A typing mistake in the code (answer)
- A real insect
- A new game
- Why does a computer need a programmer's instructions?
- It likes lists
- It cannot think for itself (answer)
- It is made of bugs
- 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