Cambridge A2 Level Computer Science 9618 · 20.1 Programming Paradigms

Q17 · 9618/32/O/N/24 Q10

Worked solution from the Further Programming Paper 3 Advanced Theory booklet, Part 1 of 2.

Q179618/32/O/N/24original Q10Structured · 6 marks
Question 10 from 9618/32/O/N/24

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 IDEAA class is the blueprint with attributes and methods; an object is one instance created from it.
TOTAL 6 marks

Official mark scheme

Mark scheme for 9618/32/O/N/24 question 10
VIDEO
▶ Whole paper

Video solution of the whole paper · by Zafar Ali Khan (ZAK). 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.