Coding · Grade 8
Objects and Program Organization
Learners model the garden app with classes: they create objects from a class blueprint, write and trace __init__ and methods that use self, and build programs where objects contain and work with other objects, including the surprise of two variables referring to the same object. They finish by designing classes with single responsibilities, deciding which data and behaviour each class owns.
- 4 lessons
- About 85 minutes
- Check what you learned: 8 questions
- Ways to answer: choose an answer, put code in order, trace code, match pairs, type a number and sort into groups
What learners will discover
- Explain classes as blueprints and objects as instances that each store their own attribute values.
- Write and trace __init__ and methods that use self to read and change an object's attributes.
- Trace programs with several interacting objects, including containers of objects and shared references.
- Organise a program into classes with clear responsibilities, choosing attributes and methods for each.
Lessons
-
Classes and objects 5 steps2 practiceabout 20 min
-
__init__, methods and self 6 steps4 practiceabout 22 min
-
Many objects working together 6 steps4 practiceabout 22 min
-
Organising a program with classes 5 steps3 practiceabout 18 min
-
Check what you learned 8 questions at the end
Keep exploring
Games to practice with
- 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.
- Garden AutomationProgram a garden robot with sensor rules — then watch a whole day play out.
More 8th grade coding
- 8th Grade Coding Games4 games to play free
- 8th 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