Skip to main content
Work out how many layers of a pyramid fit in a pile of blocks, print the height and the blocks left over, then draw it with nested loops. Open Lab 14 in the IP Lab Portal

What you will practice

  • Track a running total in a loop
  • Stop when the next layer does not fit
  • Print the pyramid with nested loops

Before you start

Time

20 minutes

Where

IP Lab Portal

Module

Module 5: Loops

  • In the IP Lab Portal, open Lab 14 - Block pyramid.
  • In class, this lab comes right after the Lesson 6 recap slide in Module 5 core material.