0% found this document useful (0 votes)
107 views9 pages

Test Option D1-D2

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)
107 views9 pages

Test Option D1-D2

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/ 9

Test Option D1-D2 [32 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: 7] 23M.2.SL.TZ0.11
(a) Define the term encapsulation. [1]

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

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


Room. [3]
3. [Maximum mark: 4] 20N.2.SL.TZ0.b
Outline two differences between inheritance and aggregation. [4]
4. [Maximum mark: 9] 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) Define the term inheritance. [2]

(b) Explain one advantage of the OOP feature “inheritance” with


reference to this scenario. [3]

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


5. [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]
© International Baccalaureate Organization, 2024

You might also like