Coding · Grade 5
Nested Loops and Patterns
Fifth graders trace nested loops (the inner loop runs completely for every time round the outer loop), use them to build rows-and-columns patterns, make growing triangle patterns by using the outer counter in the inner loop, and program robots with repeats inside repeats.
- 4 lessons
- About 90 minutes
- Nested loops check: 8 questions
- Ways to answer: program with blocks, choose an answer, trace code and type a number
What learners will discover
- Trace a nested loop and count how many times the inner body runs.
- Use nested loops to make 2D patterns of rows and columns.
- Use the outer counter inside the inner loop to make growing patterns.
- Program robot paths with repeats inside repeats.
Lessons
-
Loops inside loops 4 steps2 practiceabout 17 min
-
Rows and columns 4 steps2 practiceabout 17 min
-
Growing patterns 4 steps2 practiceabout 16 min
-
Nested repeats for robots 5 steps2 practiceabout 18 min
-
Nested loops check 8 questions at the end
Keep exploring
Games to practice with
- Robot RoutesSnap together arrow, repeat and dance blocks to guide Bolt the robot home.
- Bug DetectiveA robot program almost works. Run it, spot the buggy block, and fix it.
- Sorting FactoryTurn a work order into if/else rules and watch the conveyor sort every item.
More 5th grade coding
- 5th Grade Coding Games5 games to play free
- 5th Grade Coding Worksheets10 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read