Grade 10 Computer Science · Objects
Summary practice — objects
Ten exercises going over everything the unit taught.
A mould, a case, a subject, a layer and a border
Five ideas, and all of them really answer one question. These exercises check whether, when you see data and an operation, you now ask who should hold what, and who will be hurt when something changes.
This unit really taught one thing: who is responsible for what. An object joins data to its operations, a class is the mould it is created from, a method is an operation with a subject, correct decomposition gives each class one layer, and a correct boundary keeps your freedom to change. The ten exercises below touch all five.
Review — the order in which an object is built
- A class is defined with fields and operations.
- The constructor initialises all the fields.
- Objects are created from it.
- Each has a separate copy of the data.