9618/32/O/N/24 question 10: worked solution (October/November 2024, paper 32)
Show as plain textHide plain text
Cambridge A2 Level Computer Science 9618 · 20.1 Programming Paradigms Worked solution from the Further Programming Paper 3 Advanced Theory booklet, Part 1 of 2. Q17 9618/32/O/N/24 original Q10 Structured · 6 marks Worked solution (a) Write any three points: A class has attributes (properties) with their data types. [1] It has methods , which are subroutines that work on the attributes. [1] It has getters and setters , which read or change the attributes. [1] A constructor creates objects (instances) of the class. This is a fourth point that can replace any one of the three above. Any three of these four points score, one mark each. (b) Write any three differences: A class is a template (blueprint) defined once, and an object is an instance of it; many objects can come from one class. [1] No memory is used when a class is defined, but an object is given memory when it is created. [1] A class is defined but an object is declared / created / instantiated. [1] Also accepted: a class can use inheritance , an object cannot; a class cannot be used directly in the running program, but an object can. Any three different points score, one mark each. KEY IDEA A class is the blueprint with attributes and methods; an object is one instance created from it. TOTAL 6 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.