Loading preview...

Features

  • Code drawn as blocks, with each repeat loop as a C-shaped block around the steps it repeats
  • Programs that say number patterns: add, subtract and multiply
  • Programs that draw paths on a grid, and the length of each path
  • Count how many times a step runs in nested loops
  • Rewrite long code shorter with a repeat loop
  • Change one part of a program and explain what changes
  • A worked example on every page
  • Answer keys included

Skills Covered

  • Read and run code with steps in order
  • Follow repeat loops and nested loops
  • Predict the number pattern a program makes
  • Count how many times a step runs
  • Rewrite repeated steps as a loop
  • Change code and explain how the result changes

How to Use This Pack

Five pages of coding with no computer. A step is a white block; a repeat loop is a gray C-shaped block that runs the steps inside it again and again, and a loop inside a loop is a nested loop. Page 1 runs six programs that start n at a number and write the numbers each one says. Page 2 draws the path each program makes on a grid, starting at the dot, and finds its length in units. Page 3 counts how many times each step runs, with claps, stomps and jumps, and finds n at the end. Page 4 turns long code into short code by filling in a repeat loop. Page 5 changes one part of a program, writes what it says now and explains what changed.

In the Classroom

Act out the clap and stomp programs on page 3 as a class: one student reads the code aloud and everyone else claps and stomps, keeping count on their fingers. Then ask how the count comes from the numbers in the loops. For page 2, students can walk the path on floor tiles before drawing it.

At Home

Write a short loop on a sticky note, such as repeat 3 times: clap, clap, jump, and run it together. Ask your child to guess the number of claps before you start, then change one number in the loop and guess again.

Tips for Success

  • A step inside a loop runs once each time round the loop
  • In a nested loop, the inside loop runs all the way through each time the outside loop runs once
  • Multiply the loop counts to find how many times an inside step runs
  • Order matters: say n before or after a change gives different numbers
  • Keep track of n in the margin as you run a program

Common Core Standards Alignment

This pack supports the following Common Core State Standards for Mathematics:

  • 4.OA.C.5 Make a number or shape pattern from a rule and notice features the rule does not say, such as terms switching between odd and even.

© Copyright 2010. National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

Repeat and Nested Loops

4th Grade

Unplugged coding with repeat loops and loops inside loops, drawn as blocks. Students run programs that make number patterns and grid paths, count how many times steps run, rewrite long code with loops and explain what a change does.

Download PDF
Pin

What’s Included

  • 5 worksheets with answer keys
  • Number programs, grid paths and step counts
  • Rewriting code with loops
  • Changing code and explaining the effect
Can’t find what you need?

Tell us what to make next, or build your own with a worksheet maker.

Suggest a worksheet

Free to print and share

This worksheet is free to download, print, copy, and hand out in your classroom or at home. You do not need to create an account, and there are no watermarks on the PDF.