Differentiate between an accessor method and a mutator method.
About this question
Question 5.4.1 of Information Technology Grade 12 Paper 2, NSC Preparatory Examination (Eastern Cape DoE, September 2025). It tests the Term 1 ATP topic Object-Oriented Programming (OOP).
- TermTerm 1
- ATP topicObject-Oriented Programming (OOP)
- PaperPaper 2
- Marks2 marks

An accessor method retrieves the value of an instance variable.
A mutator method changes the value of an instance variable.
More Questions On Object-Oriented Programming (OOP)
D: Encapsulation is about restricting direct access to the fields of an object.
Fields are kept private and reached only through methods.
An algorithm is a sequence of steps that can be followed to solve a problem.
C: 13
Floor(10.4) = 10 and 19 DIV 4 = 4, so 10 + 6/2*4/4 = 10 + 3 = 13.
It causes an error, because Append places the file pointer at the end and opens the file for writing only, so it cannot be read.
The number of lines in the file is not known in advance, so a For loop cannot be set up.
