Intro to Looping or Repeat in Computer Science
Overview
This is a lesson to be used by teachers in the PreK-2nd grades. It involves students learning a computer science concept without a device and with lots of physical movement. All of the needed resources are linked or included.
Looping or Repeat in Computer Science
Lower primary students need lots of practice using computer science concepts. This resource includeds full body movement as well as work with code to reinforce the concept of a loop or repeat. It integrates into math and literature units when teaching patterns and sequencing. This resource is written for teachers. Most students in the lower primary grades would find the reading of the directions too overwhelming.
Getting Started
Resources needed:
- Access to Go Noodle and other links in the lesson on the web
- Access to songs that have repeating lines/verses
- For example: "The Ants Go Marching"
- Unit where students are learning about patterns and/or sequencing
- Vocabulary
- Loop - somthing that is done more than once in a row
- Repeat - somthing that is done more than once in a row
- Effiecient - quickest and simplest
The Lesson
Activity One (In this activity students will be introduced to vocabulary):
- Play the video/song "Banana, Banana, Meatball" from Go Noodle while students sing and dance along. You may want to play it more than once.
- Review what a pattern looks like - something that repeats - and play the video/song again while students look for those patterns/repeats and how many times the pattern repeats.
- They should notice the "Banana, Banana, Meatball" right away and it repeats six times.
- The other repeats are:
- "Nod, clap, shake your hips"
- "Loud, loud, quiet, quiet"
- "Elbow, stomach, stomach, elbow"
- Some students may also not that the verse "Make a pattern, make a patterm, Let's make a pattern" repeats twice several times in the song
- The other repeats are:
- Give the directions for "banana, banana, meatball" six times and have students follow those directions six times. Show them what that would look like if you wrote down the words:
- banana, banana, meatball
- banana, banana, meatball
- banana, banana, meatball
- banana, banana, meatball
- banana, banana, meatball
- banana, banana, meatball
- Talk about how this could be made more efficient if you had to write those directions. Students should come up with something like, "Do banana, banana, meatball" six times.
- Next, students work with a partner and give the partner directions to do something more than once and then come up with a more efficient way. They can use the other patterns from the song "Banana, banana, meatball" or come up with their own.
- For example: Turn around, turn around, turn around, turn around or more efficiently Turn around four times.
- They should notice the "Banana, Banana, Meatball" right away and it repeats six times.
Activity Two (In this activity students will be introduced to using written numbers to the take place of saying the number of times to loop or repeat):
- Play and sing "Baby Shark"
- Project the lyrics for "Baby Shark"
- Students take turns finding the repeats and circle them and put a number to show how many times it is repeated/looped.
- For example:
4. Now have the students tell you how to rewrite the song more efficiently. "3 times sing Baby shark with 6 doos". Continue this with the rest of the song. (The Baby Shark original and more efficent lyrics are attached to this section.)
Activity Three (In this activity students will use a new song and work independently or with a partner to find the repeats)
- Play and sing "Fred the Moose"
- Pass out "Fred the Moose" lyrics and students work indepentdenly or with a partner to find and circle the repeats with the number of times they are repeated.
- As a class share work and discuss what they have learned about repeats, loops, and effiecincy.
Follow Up
After completing this lesson have students watch for repeats or loops that can be made more efficient. It can be in directions, in other songs, in books, and even in shapes. Use the vocabulary words often and include them on your word wall.
When students begin coding the concept of looping or repeating will more easily understood and transferred to code. Using code efficently will make sense as well.