Grade 4: "nested loops"
(From: code.org https://curriculum.code.org/csf-20/coursef/5/ )If you need any assistance in setting up your class in code.org, do not hesitate to contact Erica Doucet, Kerry Crocker or Haley Brooks.
On a computer? Click "file" then "make a copy" to save and make changes.
On an iPad? Select the 3 dots in the top right hand corner. "Share and Export" then "Make a Copy".
C3.1 solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves sequential, concurrent, repeating, and nested events
learn how to program a loop to be inside of another loop. They will also be encouraged to figure out how little changes in either loop will affect their program when they click Run.
Break complex tasks into smaller repeatable sections.
Recognize large repeated patterns as made from smaller repeated patterns.
Identify the benefits of using a loop structure instead of manual repetition.
Access to Code.org.
Teacher Prep:
Set up class sections and student accounts.
Send parents a Code.org letter explaining why their child is learning computer science and how they can help their child sign in at home.
Share login information with students and parents.
Use the teacher dashboard to track student progress. You can now see when your students last worked on the assigned course.
Paper/pencil
iPads
Loop - The action of doing something over and over again.
Repeat - To do something again
Briefly review with the class what loops are and why we use them.
What do loops do?
Loops repeat a set of commands. (see vocabulary on command if students don't recognize it)
How do we use loops?
We use loops to create a pattern made of repeated actions.
Tell the class that they will now be doing something super cool: using loops inside loops. Ask the class to predict what kinds of things we would be using a loop inside of a loop for.
"If a loop repeats a pattern, then looping a loop would repeat a pattern of patterns!"
Students don't need to understand this right away, so feel free to move on to the online puzzles in code.org even if students still seem a little confused.
Show students the video below about "Pair Programming" This may not be an easy topic for the majority of your students. Working with a partner and discussing potential solutions to the puzzles might ease the students' minds.
Also, have paper and pencils nearby for students to write out their plan before coding. Some puzzles have a limit on the number of certain blocks you can use, so if students like to write out the long answer to find the repeats, paper can be useful.
You will find this online puzzle in Course F, 2020 on Code.org.
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 about today's lesson?
What is a nested loop?
Can you draw a puzzle that would use a nested loop? Try coding the solution to your own puzzle.
Opportunities for Assessment
SEL Self-Assessments (English) and Teacher Rubric