0% found this document useful (0 votes)
48 views

The Bcs Professional Examinations BCS Level 5 Diploma in IT: The British Computer Society

This document contains information about an exam for the BCS Level 5 Diploma in IT. The exam will cover object oriented programming concepts and will consist of 6 questions to choose from, with a time limit of 2 hours. Calculators are not allowed. The questions will cover topics such as static vs dynamic typing, class vs type, inheritance, memory management in OOP, use case diagrams, design patterns, and class diagrams for modeling a banking system.

Uploaded by

Ozioma Ihekwoaba
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)
48 views

The Bcs Professional Examinations BCS Level 5 Diploma in IT: The British Computer Society

This document contains information about an exam for the BCS Level 5 Diploma in IT. The exam will cover object oriented programming concepts and will consist of 6 questions to choose from, with a time limit of 2 hours. Calculators are not allowed. The questions will cover topics such as static vs dynamic typing, class vs type, inheritance, memory management in OOP, use case diagrams, design patterns, and class diagrams for modeling a banking system.

Uploaded by

Ozioma Ihekwoaba
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/ 4

THE BRITISH COMPUTER SOCIETY

THE BCS PROFESSIONAL EXAMINATIONS


BCS Level 5 Diploma in IT
OBJECT ORIENTED PROGRAMMING
Wednesday 15th October 2008 - Morning
Answer FOUR questions out of SIX. All questions carry equal marks
Time: TWO hours
The marks given in brackets are indicative of the weight given to each part of the question.

Calculators are NOT allowed in this examination.

1)

a)

You are working for a company which has decided to develop software using an object
oriented approach but has yet to standardise on a given language. Your manager has
discovered that some object oriented languages such as Java or C# implement static
typing while other languages such as Smalltalk or Ruby implement dynamic typing.
Write a report which outlines the advantages and disadvantages of static and dynamic
typing.
(8 marks)

2.

b)

After reading the report your manager asks you to differentiate between the concepts
class and type. Write a further report that achieves this.
(8 marks)

c)

Inheritance permits the creation of objects which belong to one class but conform to
more than one type. Explain this statement.
(9 marks)

a)

In languages such as C which do not support objects, programmers commonly call


subroutines to allocate memory for data storage and then manipulate this data via
pointers. Explain the equivalent mechanisms in object oriented programming
languages.
(8 marks)

b)

Object oriented languages contain mechanisms to initialise automatically memory when


it is allocated. Use code examples to show how these mechanisms are used and show
how they operate for objects that are instances of a subclass.
(8 marks)

c)

Where programs acquire memory dynamically it is important that there is a mechanism


for releasing memory when it is no longer required. Compare and contrast two such
mechanisms used in object oriented programming languages.
(9 marks)

Turn over]

3.

a)

Give the meaning of the following terms:


i)
ii)
iii)

Abstraction;
Encapsulation;
Data hiding.
(9 marks)

4.

b)

A programmer wishes to create a set of classes that implement collections (e.g. Set,
SortedSet, List, SortedList). Explain how abstraction, encapsulation and data hiding
can be used to create generic classes for this purpose.
(10 marks)

c)

Describe the contribution that abstraction, encapsulation and data hiding make to the
potential of a language to encourage software reuse.
(6 marks)
PC Wide is a store selling computers and related goods, which employs a number of sales
assistants. Each sales assistant works at an electronic till. The first thing that a sales
assistant does when he/she starts work, is to login to the sales system, to which all tills are
connected. Logging in identifies them to the system. If the sales assistant has finished
work, or needs to leave the till for any reason, he/she must log off the till. Only registered
users can login to a till. The Store Manager registers the sales assistants with the system.
The Store Manager can also remove the users from the system if they leave.
When a customer wishes to purchase an item, they will approach a sales assistant, who
receives the payment, which can be either cash or credit card, from the customer. The
details of the payment are entered into the till, which records that the item has been
purchased. For expensive items, such as a laptop, the system will optionally offer the
customer insurance on the item, which they can either accept or reject. At the end of the
transaction a receipt is printed.
If the customer is unhappy with the purchase, they can return it to the shop within 15 days.
The customer will take the purchase to a sales assistant who will refund their money and
records the return of the item via the till.
Every week the Store Manager generates a sales report, which shows what items have
been sold that week.
a)

Draw a use case diagram for this system.


(15 marks)

b)

Discuss how Use Case diagrams and scenarios contribute to the development of
the usage requirements of a system. Within your answer include examples from the
above scenario.
(10 marks)

5.

a)

Explain what is meant by the term design pattern in the context of object oriented
programming. Within your discussion, highlight what is the motivation for using
design patterns from a programmers point of view.
(10 marks)

b)

Design patterns can be classified according to the problem they solve. For
example:
Creational Patterns:
Abstract factory, Builder, Object Pool and Singleton patterns
Structural Patterns:
Adaptor, Decorator, Faade and Proxy patterns
Behavioural Patterns:
Command, Iterator, Observer and State patterns
Choose ONE design pattern from EACH of the above classifications and give a
detailed description of each, stating the problem they address and the basis of the
solution they offer.
(15 marks)

Turn over]

6.

The class diagram below represents a Banking system that records what type of customers
they have and their accounts.
Account
-accountNumber : int
-type : string
-balance : float
-overdraftLimit : float
Customer

Branch
1

-branchNumber : string
-name : string
-address : string
-telephoneNumber : string

1..*

-has

-customerNumber : string
-name : string
-address : string
-telephoneNumber : string
-noOfCustomers : int

1..*

-assignedTo

-employs

-worksFor

Employee
-employeeNumber : string
-name : string
-address : string
-extensionNumber : int
-salary : float

Business

Personal

-faxNumber : string
-annualTurnover : float

-emailAddress : string
-mobileNumber : string

-lookedAfterBy

Business Manager

-assignedTo

-commission : float
*

a)

Describe what the diagram above represents. Include all structural constraints.
(15 marks)

b)

Explain why the object diagrams below (i-ii) are not legitimate instances. State how they
can be made legitimate.
(5 marks)

i)

ii)

c)

What is the purpose of an activity diagram? Describe how they might help in the development
of the Banking system.
(5 marks)

You might also like