Coding · Grade 4
Conditions and Branching
Fourth graders use IF, ELSE IF and ELSE to choose between many paths, learn that the first true condition wins (so order matters), trace nested decisions, and test every branch, including the boundaries between branches.
- 4 lessons
- About 85 minutes
- Branching check: 8 questions
- Ways to answer: choose an answer, trace code, highlight a text, match pairs, type a number and sort into groups
What learners will discover
- Use IF, ELSE IF and ELSE to choose between more than two paths, checking conditions from the top.
- Put conditions in the right order so that ranges work, because the first true condition wins.
- Trace nested decisions: an IF inside another IF.
- Test every branch of a program, including the boundaries between branches.
Lessons
-
More than two paths 4 steps2 practiceabout 16 min
-
Order matters 4 steps2 practiceabout 16 min
-
Decisions inside decisions 4 steps2 practiceabout 16 min
-
Test every branch 5 steps3 practiceabout 15 min
-
Branching 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