Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

THE BRITISH COMPUTER SOCIETY THE BCS PROFESSIONAL EXAMINATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING

Tuesday 28th April 2009 - 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. Section A Answer Section A questions in Answer Book A

A1.

a)

Distinguish between method overloading and method overriding. (5 marks)

b)

Distinguish between setter and getter methods. (5 marks)

c)

Distinguish between abstract and concrete classes. (5 marks)

d)

Distinguish between constructor and destructor methods. (5 marks)

e)

Distinguish between class and instance variables. (5 marks)

A2.

a)

Briefly outline the purpose of using access specifiers to designate the members of a class as private, protected or public. (10 marks) Distinguish between single and multiple inheritance using suitable diagrammatic examples to illustrate your answer. (5 marks) What is meant by the term signature in describing a method? (5 marks)

b)

c)

d)

What is the purpose of defining a method as abstract? (5 marks)

Turn over]

A3.

a)

Specify the symbols used in UML to represent the following inter-class relationships: i) ii) iii) iv) v) aggregation; association; composition; dependency; specialization. (5 marks)

b)

Specify the meaning of the symbols #, +, and -? between attributes and operations?

How do we distinguish (5 marks)

c)

Provide a class diagram for an online bookshop comprising at least 5 classes; include a range of instance variables. (15 marks)

Section B Answer Section B questions in Answer Book B

B4.

a)

You are working in a company which uses object-oriented programming techniques and UML as a design tool. The company is about to undertake a project which is safety critical. Your manager had heard that the use of the Object Constraint Language (OCL) could be beneficial in this particular project. Write a short report which explains what OCL is and how it can contribute to the construction of high quality software. (10 marks) In the context of OCL explain the following terms: i) ii) iii) pre-condition; post-condition; invariant. (9 marks)

b)

c)

Given the following UML class diagram:

BusJourney -journeyNr: Integer 0..* 0..* +journeys

+journeys 0..*

+bus 1

Bus +numberOfSeats: Integer

+passengers

Person -name: String

Explain the meaning of the following OCL fragment: context BusJourney inv: passengers->size() <= bus.numberOfSeats (6 marks)

Turn over]

B5.

a)

Explain what is meant by the techniques black-box testing and white-box testing and how they may be used when testing object-oriented software. (10 marks) Explain the purpose of integration testing and how it is used to assure the quality of object-oriented systems. Why is the integration testing of an object-oriented system likely to be more complex than that for a system developed using a topdown decomposition approach? (10 marks) Discuss whether, when testing a subclass, it is safe to assume that all the methods inherited from a previously tested superclass will function correctly. (5 marks)

b)

c)

B6.

a)

Define the following terms: i) ii) iii) iv) object oriented languages and typed languages; structured programming and procedural programming; abstract data types and encapsulation; coupling and cohesion. (16 marks)

b)

Discuss the way in which features of object-oriented languages support the enforcement of good programming practice. (9 marks)

You might also like