< Express Course (2024)

Lesson 28: For Loops with Bee

60 minutes

Overview

This skill-building lesson focuses on for loops and using an incrementing variable to solve more complicated puzzles.

Purpose

Today's concept, for loops are a very important topic in computer science. Not only are they widely used, the process of learning for loops enhances the learning of other important concepts (such as variables and parameters.) Students will have plenty of practice critically thinking through problems by determining the starting, ending, and stepping values for each for loop. This concept uses plenty of math as well, so feel free to pair it with a math lesson for an even deeper learning experience.

CSTA K-12 Computer Science Standards (2017)
    • 1B-AP-09 - Create programs that use variables to store and modify data.
    • 1B-AP-11 - Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.

Agenda

Objectives

Students will be able to:
  • Determine starting value, stopping value, and stepping value for a for loop.
  • Recognize when to use a for loop and when to use other loops such as repeat and while loops.

Preparation

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

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the teachers
For the students

Vocabulary

  • For Loop - Loops that have a predetermined beginning, end, and increment (step interval).

Teaching Guide

Warm Up (15 minutes)

Introduction

Display a puzzle from the lesson. We recommend the prediction level because it displays a potential solution and asks the user to evaluate it.

Main Activity (30 minutes)

For Loops With Bee

Online Puzzles

Some students may have a hard time differentiating between repeat loops and for loops. We recommend having scratch paper out for students to make guesses on values like the start, stop, and step. Implementing pair programming amongst the class might also be helpful for your students.

Wrap Up (15 minutes)

Reflection

Prompts:

  • What was today’s lesson about?
  • How did you feel during today’s lesson?
  • How is a for loop different from a repeat loop?
  • Why do you think for loops could be useful?
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.