Lesson 11: Harvesting Crops with Loops
Overview
Students loop new actions in order to help the harvester collect multiple veggies growing in large bunches.
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.
Agenda
Warm Up (5 - 10 min)
Main Activity (30 min)
Wrap Up (10 min)
Extended Activity
View on Code Studio
Objectives
Students will be able to:
- Write a program for a given task which loops a single command.
- Identify when a loop can be used to simplify a repetitive action.
- Employ a combination of sequential and looped commands to move and perform actions.
Preparation
- Play through the puzzles to find any potential problem areas for your class.
- Make sure every student has a journal.
Vocabulary
- Loop - The action of doing something over and over again.
- Repeat - To do something again.
Support
Report a Bug
Teaching Guide
Warm Up (5 - 10 min)
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 min)
Online Puzzles
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 min)
Journaling
Having students write about what they learned, why it’s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.
Journal 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 Activity
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.
- The Harvester
- 1
Student Instructions
Loops can be used to repeat more than moves.
Use loops to collect all four of the pumpkins.
Student Instructions
Can you combine two different loops to move toward the pumpkins, then collect them all?
Student Instructions
Collect all of the pumpkins.
Student Instructions
Now there is corn growing, too!
Collect all of the corn and all of the pumpkins.
Student Instructions
Collect all of the corn and all of the pumpkins.
Student Instructions
Collect all of the corn and all of the pumpkins.
Student Instructions
Collect all of the corn and all of the pumpkins.
- Challenge
- 9
Student Instructions
Challenge: Collect all of the corn and all of the pumpkins.
You can complete this challenge any way you want, but it will either take a lot of work or a lot of thinking!
Student Instructions
Collect all of the corn and all of the pumpkins.
Student Instructions
Collect all of the corn and all of the pumpkins.
Student Instructions
Collect all of the corn and all of the pumpkins.
- Predict
- 13
Student Instructions
Look closely at the code below. How many pumpkins will the farmer collect after you click "Run"?
4
12
15
I don't know.
Student Instructions
Student Instructions
Collect all of the lettuce. Avoid the trees and fields!
Standards Alignment
View full course alignment
CSTA K-12 Computer Science Standards (2017)
AP - Algorithms & Programming
- 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.
Cross-curricular Opportunities
This list represents opportunities in this lesson to support standards in other content areas.
Common Core English Language Arts Standards
L - Language
- 2.L.6 - Use words and phrases acquired through conversations, reading and being read to, and responding to texts, including using adjectives and adverbs to describe (e.g., When other kids are happy that makes me happy).
SL - Speaking & Listening
- 2.SL.1 - Participate in collaborative conversations with diverse partners about grade 2 topics and texts with peers and adults in small and larger groups.
Common Core Math Standards
MP - Math Practices
- MP.1 - Make sense of problems and persevere in solving them
- MP.2 - Reason abstractly and quantitatively
- MP.4 - Model with mathematics
- MP.5 - Use appropriate tools strategically
- MP.6 - Attend to precision
- MP.7 - Look for and make use of structure
- MP.8 - Look for and express regularity in repeated reasoning
OA - Operations And Algebraic Thinking
- 2.OA.1 - Use addition and subtraction within 100 to solve one- and two-step word problems involving situations of adding to, taking from, putting together, taking apart, and comparing, with unknowns in all positions, e.g., by using drawings and equations with a sy
Next Generation Science Standards
ETS - Engineering in the Sciences
ETS1 - Engineering Design
- K-2-ETS1-1 - Ask questions, make observations, and gather information about a situation people want to change to define a simple problem that can be solved through the development of a new or improved object or tool.
- K-2-ETS1-2 - Develop a simple sketch, drawing, or physical model to illustrate how the shape of an object helps it function as needed to solve a given problem.
- K-2-ETS1-3 - Analyze data from tests of two objects designed to solve the same problem to compare the strengths and weaknesses of how each performs.