Worked solution from the Further Programming Paper 3 Advanced Theory booklet, Part 1 of 2.
Write one definition for each term:
Encapsulation: putting the properties and methods inside a class, which hides the data from users [1]
Getter: a method that returns the value of a property [1]
Setter: a method that updates the value of a property [1]
Add the missing property (Telephone), then a setter and getter for each of the three properties.
SubstituteTeacher ----------------- SubName : STRING Telephone : STRING InSchool : BOOLEAN ----------------- SetSubName(StaffName : STRING) SetTelephone(Tel : STRING) SetInSchool(Present : BOOLEAN) GetSubName() GetTelephone() GetInSchool()
Properties correct: Telephone : STRING added [1]
Setters correct: SetSubName and SetInSchool added [1]
Getters correct: GetTelephone() and GetInSchool() added [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.