Solar System | Mini Lesson
In this 15-minute mini lesson, adult learners use a solar system theme to practice advanced coding concepts by modeling planetary data, organizing related properties, and iterating over collections. The lesson emphasizes structured thinking, clean code, and applying object-like or dictionary-based data representation to a real-world-inspired topic.
| Term | Definition |
|---|---|
| Data structure | A way to organize information so it can be stored and used efficiently in code. |
| Object | A grouped set of related data and behaviors, often used to model real-world things. |
| Dictionary | A key-value data structure used to store related information by name. |
| Iteration | Repeating a set of instructions for each item in a collection. |
| Abstraction | Simplifying something complex by focusing only on the most important details. |
Display a solar system image and ask: What information about a planet would be useful to store in code? Elicit examples such as name, order from the sun, number of moons, and type.
Respond verbally and identify data that could be represented programmatically.
Show a sample planet object/dictionary and explain how keys map to values. Briefly connect the structure to real-world organization and note how advanced code uses collections of these records.
Observe the model, ask clarifying questions, and identify the parts of the structure.
Walk learners through creating an array/list of planet objects. Demonstrate one loop that prints each planet's name and one additional property, such as moons or type. Prompt learners to predict output before running it.
Code along, follow the example, and test the loop output in their editor.
Ask learners to extend the model by adding a computed property or filter, such as finding all rocky planets or identifying the planet with the most moons. Circulate and support as needed.
Modify the starter code, run tests locally, and troubleshoot syntax or logic issues.
Invite one or two learners to share their solution and explain the logic used. Reinforce the idea that abstractions make complex systems manageable.
Describe their approach and compare different ways to structure the same information.
Review the key idea: advanced code often uses structured data plus iteration to represent and process real-world systems. Connect the solar system model to other domains such as inventories, employee records, or product catalogs.