0% found this document useful (0 votes)
6 views6 pages

Heq Oct21 Dip Oop

Uploaded by

hlt.ariapala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

Heq Oct21 Dip Oop

Uploaded by

hlt.ariapala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

BCS THE CHARTERED INSTITUTE FOR IT

BCS HIGHER EDUCATION QUALIFICATIONS


BCS Level 5 Diploma in IT

OBJECT ORIENTED PROGRAMMING

Monday 4th October 2021 - Afternoon

Answer any FOUR questions out of SIX. All questions carry equal marks.

Time: TWO hours

Answer any Section A questions you attempt in Answer Book A


Answer any Section B questions you attempt in Answer Book B

The marks given in brackets are indicative of the weight given to each part of the question.

Calculators are NOT allowed in this examination.


PAGE LEFT INTENTIONALLY BLANK

(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)

b) Explain how structured and procedural languages contributed to the development of


object oriented programming languages.
(9 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:

public class Module {


private int moduleCode;
private String moduleName;
private int noOfCredits = 20;
public Module(int mno, String name){
moduleCode=mno;
moduleName=name;
}
public Module(int mno, String name, int noc){
moduleCode=mno;
moduleName=name;
noOfCredits = noc;
}
}
public class Student {
private int studentNo;
private String studentName;
private static int studentCount = 0;

public Student(int sno, String name){


studentNo=sno;
studentName=name;
studentCount++;
}
}
public class Registration {
private Student aStudent;
private Module aModule;
private int result;

public Registration(Student s, Module m) {


aStudent = s;
aModule = m;
}

public void setResult (int mark) {


if ((mark >= 0) && (mark <=100))
result = mark;
else
System.out.println("ERROR: not a valid mark");
}
}

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)

b) Write a code fragment that demonstrates an appropriate use of hierarchical inheritance


(i.e., a realistic scenario that would be well-suited to the use of hierarchical
inheritance).
(15 marks)

End of Examination

(page 6)

You might also like