Heq Oct21 Dip Oop
Heq Oct21 Dip Oop
Answer any FOUR questions out of SIX. All questions carry equal marks.
The marks given in brackets are indicative of the weight given to each part of the question.
(page 2)
Section A
Answer Section A questions in Answer Book A
A1.
a) Discuss the role of the following UML diagrams in the development of an object
oriented system. Include brief examples of their use:
i) Component diagram;
ii) Object diagram;
iii) State diagram.
(15 marks)
b) Explain the role of the Object Constraint Language in the development of an object
oriented program.
(10 marks)
A2.
a) Explain what the terms coupling and cohesion mean in an object oriented system.
(10 marks)
c) Discuss the way in which typed and untyped languages differ when implementing code.
In your discussion, include ONE example of code to demonstrate the differences.
(6 marks)
[Turn Over]
(page 3)
A3.
a) You have been asked to maintain an existing system and have been presented with
the object-oriented code below.
To aid your understanding of the system draw a class diagram to represent this
information:
You can assume that other appropriate setter and getter methods have been defined,
but are not fully documented here and do not need to be included in the class
diagram. (12 marks)
(page 4)
b) Draw TWO object interaction diagrams, one to represent a valid instantiation of at least
TWO of the previous classes and one to show an invalid one. Explain why the invalid
diagram is incorrect.
(4 marks)
c) Explain how state transition diagrams can aid the testing of a system.
(9 marks)
[Turn Over]
(page 5)
Section B
Answer Section B questions in Answer Book B
B4.
a) Describe TWO potential disadvantages of the object oriented programming paradigm
when compared with procedural programming.
(10 marks)
b) Write a code fragment that demonstrates an appropriate use of an abstract class (i.e.,
a realistic scenario that would be well-suited to the use of abstract classes).
(15 marks)
B5.
a) Describe a realistic scenario in which overloading may be appropriate or necessary in
the development of an object oriented program.
(10 marks)
b) Write a code fragment that demonstrates how the open-closed principle of object
oriented programming may be implemented in practice.
(15 marks)
B6.
a) Describe TWO features of the object oriented programming paradigm that lend
themselves to the development of reusable code.
(10 marks)
End of Examination
(page 6)