Define Encapsulation:
- (a)(i)Define Encapsulation:[1]
- (a)(ii)Define Getter:[1]
- (a)(iii)Define Setter:[1]
- (b)A school has a program written using OOP to maintain its staff and student records. The object SubstituteTeacher allows the details of the school's substitute teachers to be stored. This includes their full name, telephone number and whether or not they are in school today. For example: SubName Sarah Jones Telephone 01223658721 InSchool TRUE Complete the diagram for the object SubstituteTeacher, including appropriate properties and their getters and setters. [Figure X.X][3]
This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2022). The mark or mark type is shown in brackets.
- [1] (a) One mark for each correct OOP term definition • Encapsulation – putting properties and methods inside a class // ensures sensitive data is hidden from users by hiding values of a structured data object inside a class.
- [1] (a) • Getter - method that is used to return the value of a property.
- [1] (a) • Setter - method that is used to update the value of a property.
- [1] (b) One mark for each point • properties correct
- [1] (b) • setters correct
- [1] (b) • getters correct SubstituteTeacher SubName : STRING Telephone : STRING InSchool : BOOLEAN SetSubName (StaffName : STRING) SetTelephone (Tel : STRING) SetInSchool (Present : BOOLEAN) GetSubName() GetTelephone() GetInSchool()
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →