< Course C (2021)

Lesson 9: Harvesting Crops with Loops

45 minutes

Overview

Students loop new actions to help the harvester collect multiple veggies growing in large bunches in this skill-building lesson.

Purpose

In this lesson, students will use loops to repeat actions like harvesting pumpkins. New patterns will emerge and students will use creativity and logical thinking to determine what code needs to be repeated and how many times.

CSTA K-12 Computer Science Standards (2017)
    • 1A-AP-09 - Model the way programs store and manipulate data by using numbers or other symbols to represent information.
    • 1A-AP-10 - Develop programs with sequences and simple loops, to express ideas or address a problem.
    • 1A-AP-11 - Decompose (break down) the steps needed to solve a problem into a precise sequence of instructions.
    • 1A-AP-14 - Debug (identify and fix) errors in an algorithm or program that includes sequences and simple loops.

Agenda

Objectives

Students will be able to:
  • Employ a combination of sequential and looped commands to move and perform actions.
  • Identify when a loop can be used to simplify a repetitive action.
  • Write a program for a given task which loops a single command.

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 (5 minutes)

Introduction

At this point, students have only used loops in the Maze puzzles. Those puzzles focused on looping movement instructions. This stage will use loops to pick up multiple items in the same spot.

Ask:

  • What are some other elements of our programs that could benefit from loops?
  • Harvester puzzles can have lots of items in one spot. How can we use loops to pick up any number of them with just two blocks?

Main Activity (30 minutes)

Harvesting Crops with Loops

When students are using loops to repeat an action (such as harvesting pumpkins), encourage them to think about the movements before and after that action. Could those actions be brought into the loop as well?

Wrap Up (10 minutes)

Reflection

Prompts:

  • What was today’s lesson about?
  • How did you feel during today’s lesson?
  • Give two examples of when you used loops in your code.
  • What else could a farmer harvest? Draw the code block that you would need to harvest that item.

Extended Learning

Use these activities to enhance student learning. They can be used as outside of class activities or other enrichment.

Harvesting Supplies

  • Let students create piles of school supplies at their desks (pencils, erasers, etc.)
  • Have their partners figure out how a harvester would walk from pile to pile, collecting each group of items along the way.
  • Share the programs with the rest of the class.

Cross-Curricular Opportunity

Harvester's Farm (60-75 minutes)

Computer Science + English Language Arts + Math + Science

Harvester's Farm is an optional activity aligned to Common Core ELA, Common Core Math and Next Generation Science Standards, written by our teacher community. Students will use the provided graphic organizers to classify and describe items on Harvester's Farm. The graphic organizers will serve as a pre-writing component as students then write an informative/explanatory text to inform readers about what the Harvester does on her farm.

Standards Addressed:

  • CCSS.ELA-LITERACY.W.2.2: Write informative/explanatory texts in which they introduce a topic, use facts and definitions to develop points, and provide a concluding statement or section.

  • CCSS.ELA-LITERACY.W.2.5: With guidance and support from adults and peers, focus on a topic and strengthen writing as needed by revising and editing.

  • CCSS.MATH.CONTENT.2.OA.B.2: Fluently add and subtract within 20 using mental strategies.

  • NGSS.2-PS1-1: Plan and conduct an investigation to describe and classify different kinds of materials by their observable properties.

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.