0% found this document useful (0 votes)
205 views10 pages

TEST - IB COMPUTER SCIENCE OPTION D - OOP D.1 Objects As A Programming Concept D.2 Features of OOP

Uploaded by

Melih Gülcan
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)
205 views10 pages

TEST - IB COMPUTER SCIENCE OPTION D - OOP D.1 Objects As A Programming Concept D.2 Features of OOP

Uploaded by

Melih Gülcan
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/ 10

TEST - IB COMPUTER SCIENCE OPTION D - OOP D.

1 Objects
as a programming concept D.2 Features of OOP [36 marks]
TEST - IB COMPUTER SCIENCE OPTION D - OOP Name:_____________
D.1 Objectsas a programming concept
D.2 Features of OOP
[36 marks]

1. [Maximum mark: 6] 23M.2.SL.TZ0.10


A real estate business maintains an unsorted database of houses and apartments
that it tries to sell for the property owners.

The following UML diagram describes the objects in the current system.

(a) State an additional attribute in the class Property that would


have data type

(a.i) Boolean [1]

(a.ii) integer. [1]

(b) State the relationship between


(b.i) Owner and Property [1]

(b.ii) House and Property. [1]

(c) Distinguish between a class and an instantiation in this


scenario. [2]
2. [Maximum mark: 6] 23M.2.SL.TZ0.11
(a) Explain one benefit provided by encapsulation. [3]

The real estate business is planning to expand its database to include student
housing. These “houses” are usually single rooms in a privately owned house.

(b) Explain one benefit of using inheritance to create a new class


Room. [3]
3. [Maximum mark: 4] 19N.2.SL.TZ0.11
The supermarket chain wants to use this OOP simulation to experiment with
different ways of organizing their check-out system. For example, it is possible to
have different check-out counters such as cash-only or card only, or to have
check-out counters for ten items or fewer.

(a) Describe two advantages of using libraries of classes. [4]


4. [Maximum mark: 6] 19N.2.SL.TZ0.10
To improve customer satisfaction, a supermarket chain wants to create an object-
oriented program (OOP) to simulate the lines of customers at the check-outs in
their point of sale (POS) system.

This point of sale (POS) system consists of several check-out counters. After
filling their shopping carts with items, customers line up at one of the check-out
counters. In most cases, they wait in line until it is their turn to pay.

Three real-world objects are implemented using the following classes:

The UML diagram for the class POSline is provided below.

(a) State the relationship between the POSsystem and


POSline objects. [1]
(b) Draw a diagram to show the relationship between the objects
POSsystem, POSline and Cart. You are not required to draw a
complete UML diagram. [2]

(c) Distinguish between a class and an instantiation. You must


make reference to the UML provided. [3]
5. [Maximum mark: 2]
Distinguish between an object (definition, template, or class) and
instantiation. [2]
6. [Maximum mark: 6]
Construct a UML class diagram to represent an object design for a
simple library system. [6]
7. [Maximum mark: 6]
Explain how the dependency (“uses"), aggregation ("has a") and
inheritance ("is a") relationship facilitate abstraction with examples. [6]

© International Baccalaureate Organization, 2024

You might also like