Mini Minds Hub · Free printable
Crack the Variable Vault: Free Printable Worksheet for Year 4
- ForYear 4
- StageKey Stage 2
- CostFree
- FormatPrintable PDF
Crack the Variable Vault is a free printable computing worksheet for Year 4 (ages 8 to 9). Children play secret agents. They trace each agent program, write what it shows, and collect one digit of the vault code from every answer. It needs only a pencil, and page 2 gives the grown up notes, help, a stretch idea and the answers.
It comes from the Mini Minds Hub, the free library of printables from Jaques of London, the British games and toy company that has been making games for families since 1795. Print both pages, give page 1 to your child and keep page 2 for yourself. Black and white printing works well.
What is on the sheet
Each agent program uses a variable called keys. Children read the program one step at a time, keep track of what keys holds, and write the number the program shows. The programs use a variable, a repeat loop and an if check. Every answer is one digit of the vault code, so children can check their whole code against page 2 at the end.
- keys = 2. Repeat 3 times: add 1 to keys. Show keys.
- keys = 9. Repeat 4 times: take away 2 from keys. Show keys.
Worked example: tracing a different program
keys = 12. Repeat 5 times: add 5 to keys. Show keys.
This program uses different numbers from the sheet. It shows two ways to trace a program.
Method 1: trace it in a table- Write 12 as the starting value of keys.
- Go round the loop once and write the new value each time: 17, 22, 27, 32, 37.
- Count the rows. There are 5 repeats, so stop at 37.
- Show keys prints the final value.
- Each repeat adds 5, and there are 5 repeats.
- 5 repeats of adding 5 add 25 altogether.
- Add that to the start: 12 + 25 = 37.
Why trace programs on paper?
A variable is a named place where a program keeps a value, a bit like a labelled box. The value inside can change as the program runs. To trace a program means to follow it step by step and write down what the variable holds after each step. Computers follow instructions exactly, so tracing is how people check what a program will really do.
The National Curriculum for England expects children in Key Stage 2 to use sequence, selection and repetition in programs, and to work with variables. Tracing on paper lets children practise these ideas without a device. They slow down, read each instruction carefully and explain their thinking. That habit helps later when they write programs and need to find mistakes.
Quick computing facts
- A variable has a name, and the value stored under that name can change.
- A computer follows instructions in the order it is given, exactly as written.
- A set of instructions that repeats is called a loop.
- Many games use variables to keep track of things such as a score.
- Finding and fixing a mistake in a program is called debugging.
Skills and curriculum link
- Tracing a variable
- Following repeat loops
- Reading if checks
- Careful reading
- Explaining your thinking
Ideas for helping your child trace
- Start with the first lineAsk what keys holds before anything else happens. Everything that follows depends on the starting value.
- Keep the new valueEach step changes keys. The next step starts from the changed value, not from the first one.
- Count the repeatsA repeat loop does its steps again and again. Tick each go round so none is missed or added by mistake.
- Write it downJot the value of keys after each step. A short list is easier to check than doing it all in the head.
Key words
- VariableA named place in a program that stores a value. The value can change.
- ProgramA set of instructions for a computer to follow in order.
- Repeat loopA part of a program that does the same steps more than once.
- If checkA step that tests whether something is true. The program only follows the next instruction when it is.
- TraceFollow a program step by step and write down what changes.
- DigitOne of the symbols 0 to 9 used to write numbers. A code is made of digits.
How to use it
- Print both pages. Page 1 is for your child. Keep page 2, which has the notes and answers.
- Read the first program aloud together. Ask your child what keys holds at the start.
- Let them trace it their own way: a list, tally marks or counters. Ask them to write the number the program shows.
- Work through the programs in order, then check the full code against the answer page. Ask, "How did you work that out?"
- Come back another day and try any programs that felt tricky. Repeating a familiar sheet builds confidence.
Help, stretch and game ideas
If it feels too hard
Use counters or tally marks to show keys. Put out the starting number, then change the pile after each repeat. Say the new value out loud every time. Try the first program together, then let your child lead on the next.
To stretch confident children
Write your own program that shows 7, using a repeat loop and an if check. Swap with a friend and trace each other's programs. Can you both agree on what keys shows at the end?
Make it a game
Work in pairs and swap sheets. One player reads a program aloud while the other acts as the computer and says the value of keys after every step. Swap roles. Take it in turns to be the careful computer.
Mistakes to watch for
Watch forA child starts again from the first value of keys on every repeat.
Try thisRemind them that keys keeps its new value. Use a pile of counters and change it, never empty it and restart.
Watch forThe loop is repeated one time too many or too few.
Try thisDraw a small tick box for each repeat and tick one as each go round is finished. Stop when all boxes are ticked.
Watch forA child writes every value of keys, or the starting value, instead of what the program shows.
Try thisPoint to the show step. Ask, "What does the program tell the computer to show, and when?" Write only that number.
Talk about it
- What is a variable? Can you explain it using a box with a label?
- What does keys hold before the program starts?
- How did you keep track of the changes?
- What does a repeat loop save the programmer from writing?
- What does an if check decide?
- If you changed the starting value, what would you expect to change in the answer?
Take it off the page
Variable boxes
Label a cup keys and put counters inside. Follow a made up program by adding or removing counters. Say the new value each time.
Human computer
One person gives simple repeat instructions, such as clap, step, turn. The other follows them exactly. Count how many times each step happens.
Make a vault code
Write short programs on paper, each ending with a different number. Use the answers as a secret code for a family member to crack.
Who it is for
Parents
Sit beside your child for the first program, then let them lead. Ask them to explain each step in their own words. Praise careful thinking, and check the answers together at the end.
Teachers
Use it as a starter, plenary, early finisher task or table activity. It needs no preparation beyond printing. Page 2 has support and stretch ideas for mixed ability groups, and the code gives children a way to self check.
Home educators
Print it as part of a wider computing plan. It pairs well with unplugged coding games and everyday talk about instructions. You can print it again for brothers and sisters, or to revisit later.
Where this fits in computing
Before this, children follow and give simple instructions in order, and count on and back in steps. They learn that a computer needs clear, exact steps.
After this, children can use variables, loops and conditions in block based programs, and write their own. They also practise debugging, which means finding and fixing mistakes, and tracing is a useful skill for that.
Questions parents and teachers ask
- What age is Crack the Variable Vault for?
It is written for Year 4 (ages 8 to 9) in Key Stage 2. Younger children can try it with help. Older children can use it as a quick recap of variables and loops.
- What will children practise?
Children practise tracing simple programs that use a variable, a repeat loop and an if check. They write down what each program shows. Each answer gives one digit of the vault code.
- Do children need a computer?
No. It is a screen free printable that needs only paper and a pencil. Children trace the programs by reading and thinking, which makes it a good choice for quiet time or a rainy day.
- What if my child finds it hard?
Let them use counters or tally marks to show keys changing after each repeat. Say the new value aloud every time. Work through the first program together, then let them try the next one alone.
- Is it free to print?
Yes. It is free to print for home and classroom use. You can print it again for brothers and sisters, or for revision a few weeks later.
- Can teachers use it in class?
Yes. Teachers can use it as a starter, plenary, early finisher task, homework or table activity. It needs no preparation beyond printing, and page 2 includes help, a stretch idea and answers.
- Do I need to print in colour?
No. It prints well in black and white on plain A4 paper. Print both pages, give page 1 to your child and keep page 2 for the grown up.
Preview the full PDF
Made by Jaques of London, making games for families since 1795. A printable supports classroom learning and does not replace a teacher.