Worked solution from the Further Programming Paper 3 Advanced Theory booklet, Part 1 of 2.
Acrylic and Wool each need one extra property and a YarnInfo() method. All three classes inherit from Yarn.
| Class | Properties | Methods |
|---|---|---|
| Acrylic | Soft: BOOLEAN | Constructor(), YarnInfo() |
| Wool | WoolType: STRING | Constructor(), YarnInfo() |
| Mix | Percentage: INTEGER | Constructor(), YarnInfo() |
Acrylic has the property Soft : BOOLEAN [1]
Wool has the property WoolType with a suitable data type, for example STRING [1]
Acrylic and Wool both have the method YarnInfo() [1]
At least one inheritance arrow from Acrylic, Wool or Mix up to Yarn [1]
All three arrows (Acrylic, Wool and Mix to Yarn) drawn [1]
Write one short description for each term:
Properties: the data items (attributes) of an object, defined in a class [1]
Properties also have data types (characteristics) [1]
Methods: the procedures or functions (programmed instructions) in a class [1]
Methods implement the behaviour and act on the properties [1]
Inheritance: the methods and properties of one class (the super / base class) are contained in that class [1]
They are made available to, and reused by, another class (the derived class) [1]
▶ Whole paper
Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.