BCS THE CHARTERED INSTITUTE FOR IT
BCS HIGHER EDUCATION QUALIFICATIONS
                           BCS Level 5 Diploma in IT
                        OBJECT-ORIENTED PROGRAMMING
                         Wednesday 4th October 2023 – 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) What are the real-world practical scenarios in which procedure-oriented programming
         may be a more prudent choice than object-oriented programming?
                                                                                   (10 marks)
      b) Compare and contrast the concept of the Abstract Data Type (ADT) with that of the
         class.
                                                                                (15 marks)
A2.
      a) Describe what is meant by the term operator overloading and suggest a real-world
         practical scenario in which it might be used.
                                                                                 (10 marks)
      b) Contrast the concept of method overriding with that of method overloading, using
         code fragments to illustrate your answer.
                                                                                  (15 marks)
A3.
      a) Describe what is meant by the single responsibility principle in SOLID, and suggest
         how it can be operationalised in practice.
                                                                                    (10 marks)
      b) Describe what is meant by the open/closed principle in SOLID, and provide a code
         fragment that shows how it may be implemented in practice.
                                                                                 (15 marks)
                                          Page 2 of 5
                                         Section B
                        Answer Section B questions in Answer Book B
B4.
The British Library is a public library based in London and Yorkshire that stores over 170
million items. The library is open to visitors, but only members have access to their collections
and reading rooms.
There are two types of Members, Online and Full. All members must apply for an online
account, providing their personal details, such as name, address, age and contact details.
Once registered, members have access to electronic items.
To gain access to non-electronic items, such as books or journals and to the Reading rooms,
an online member has to apply for full membership, which involves booking an appointment
with a Librarian, where they need to provide two pieces of identification. If acceptable, the
member will be issued a Reader Pass, which is valid for 3 years if UK based, or 1 year if
international. If a pass is still required after this time, the Full Member will have to renew their
membership.
The catalogue of the library’s collections can be searched online; online members can view
electronic items immediately.
Full Members can view non-electronic items by booking a space in one of the Reading
Rooms. To view the items the Full Member will need to order the collection items they wish to
see. This can be done on the day of the booking, or in advance since some items are stored
offsite and must be retrieved first. Full members can view their orders online.
Each Librarian oversees one of the collections. Each month they produce a report on the
collection’s statistics, such as how often the items in the collection have been requested.
      a)   Draw a Use Case diagram for the library system.
                                                                                         (15 marks)
      b) Discuss why you should make use of Use Case diagrams and descriptions during the
         software development life cycle.
                                                                               (10 marks)
                                                                                        [Turn Over]
                                             Page 3 of 5
B5.                                                                                                      B6.
                                                                                                               a) Design patterns can be classified according to the problem they solve, for example:
        a) Given the class diagram below, state whether each of the object diagrams (i-v) are
           legitimate instances and explain your choice. Assume that all links in the object diagram
                                                                                                                         Behavioural Patterns:
           are instances of the association shown in the class diagram.
                                                                                                                               Chain of responsibility, Command, Interpreter, Iterator, Mediator,
                                                                                                                               Memento, Null Object, Observer, State, Strategy, Template Method and
                                                                                                                               Visitor patterns.
                                                                                                                         Creational Patterns:
                                                                                                                                Abstract factory, Builder, Factory Method, Object Pool, Prototype and
                                                                                                                                Singleton patterns.
                                                                                                                         Structural Patterns:
                                                                                                                                Adaptor, Bridge, Composite, Decorator, Façade, Flyweight and Proxy
                                                                                                                                patterns.
 i)                                                  iv)                                                          Pick 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)
                                                                                                               b) Explain what the terms black-box testing and white-box testing mean and how they
                                                                                                                  could be used to test object-oriented software. Include the advantages and
                                                                                                                  disadvantages of each in your discussion.
 ii)                                                 v)                                                                                                                                      (10 marks)
 iii)                                                                                                                                        END OF EXAMINATION
                                                                                          (10 marks)
        b) In an object-oriented programming language that you are familiar with, write code to
           implement the class diagram above. Within your code, provide a default constructor for
           each class that sets the variables to appropriate initial values. The class variable should
           be set and incremented appropriately.
                                                                                          (15 marks)
                                               Page 4 of 5                                                                                          Page 5 of 5