< Course D (2021)

Lesson 10: Drawing Shapes with Loops

60 minutes

Overview

This skill-building lesson builds on the understanding of loops from the previous lesson and doubles as a debugging exercise for extra problem-solving practice.

Purpose

This series highlights the power of loops with an array of puzzles meant to get students thinking about why repeat loops are superior to longhand.

CSTA K-12 Computer Science Standards (2017)
    • 1B-AP-09 - Create programs that use variables to store and modify data.
    • 1B-AP-10 - Create programs that include sequences, events, loops, and conditionals.
    • 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.
    • 1B-AP-15 - Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.

Agenda

Objectives

Students will be able to:
  • Differentiate between commands that need to be repeated in loops and commands that should be used on their own.
  • Identify the benefits of using a loop structure instead of manual repetition.

Preparation

  • Play through the puzzles to find any potential problem areas for your class.
  • Make sure every student has a reflection journal.

Vocabulary

  • Loop - The action of doing something over and over again.
  • Repeat - To do something again.

Teaching Guide

Warm Up (15 minutes)

Introduction

Students should have had an introduction to loops at this point. Based on what you think your class could benefit from, we recommend:

  • Reviewing a puzzle from the last lesson
  • Previewing a puzzle from this lesson

Any of these should help prepare your class for fun with the online puzzles!

Main Activity (30 minutes)

Online Puzzles

Some students may discover where to add repeat loops by writing out the program without loops then circling sections of repetitions. If the students in your class seem like they could benefit from this, have them keep paper and pencils beside them at their computers. Students might also enjoy drawing some of the shapes and figures on paper as they program online.

Wrap Up (15 minutes)

Reflection

Prompts:

  • What was today’s lesson about?
  • How did you feel during today’s lesson?
  • What was the coolest shape or figure you programmed today? Draw it out!
  • What is another shape or figure you could program using loops? Can you come up with the code to create it?
Creative Commons License (CC BY-NC-SA 4.0).

This work is available under a Creative Commons License (CC BY-NC-SA 4.0).

If you are interested in licensing Code.org materials for commercial purposes contact us.