Coding · Grade 4
Functions with Simple Inputs
Fourth graders define their own blocks (functions) and call them to reuse steps, give blocks inputs so one block can do slightly different jobs, trace programs that call functions (including from loops), and use Bolt's dance block to reuse a group of moves in a robot program.
- 4 lessons
- About 85 minutes
- Functions check: 8 questions
- Ways to answer: fill in the blanks, program with blocks, choose an answer, put code in order, trace code and match pairs
What learners will discover
- Define a named block (a function) and call it to reuse a group of steps.
- Use an input (parameter) so that one block can do slightly different jobs.
- Trace programs that call functions with different inputs, including calls inside loops.
- Use Bolt's dance block to reuse a group of moves needed in several places.
Lessons
-
Define a block, then call it 4 steps2 practiceabout 16 min
-
Blocks with inputs 5 steps3 practiceabout 16 min
-
Tracing calls 4 steps2 practiceabout 16 min
-
Bolt's dance block 5 steps2 practiceabout 17 min
-
Functions check 8 questions at the end
Keep exploring
Games to practice with
- Robot RoutesSnap together arrow, repeat and dance blocks to guide Bolt the robot home.
- Bug DetectiveA robot program almost works. Run it, spot the buggy block, and fix it.
- Sorting FactoryTurn a work order into if/else rules and watch the conveyor sort every item.
More 4th grade coding
- 4th Grade Coding Games5 games to play free
- 4th Grade Coding Worksheets10 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read