Computer Science Paper 2 SL-5
Computer Science Paper 2 SL-5
All rights reserved. No part of this product may be reproduced in any form or by any
electronic or mechanical means, including information storage and retrieval systems,
without the prior written permission from the IB. Additionally, the license tied with this
product prohibits use of any selected files or extracts from this product. Use by third
parties, including but not limited to publishers, private teachers, tutoring or study services,
preparatory schools, vendors operating curriculum mapping services or teacher resource
digital platforms and app developers, whether fee-covered or not, is prohibited and is a
criminal offense.
More information on how to request written permission in the form of a license can be
obtained from https://ibo.org/become-an-ib-school/ib-publishing/licensing/applying-for-a-
license/.
Tous droits réservés. Aucune partie de ce produit ne peut être reproduite sous quelque
forme ni par quelque moyen que ce soit, électronique ou mécanique, y compris des
systèmes de stockage et de récupération d’informations, sans l’autorisation écrite
préalable de l’IB. De plus, la licence associée à ce produit interdit toute utilisation de tout
fichier ou extrait sélectionné dans ce produit. L’utilisation par des tiers, y compris, sans
toutefois s’y limiter, des éditeurs, des professeurs particuliers, des services de tutorat ou
d’aide aux études, des établissements de préparation à l’enseignement supérieur, des
fournisseurs de services de planification des programmes d’études, des gestionnaires de
plateformes pédagogiques en ligne, et des développeurs d’applications, moyennant
paiement ou non, est interdite et constitue une infraction pénale.
Pour plus d’informations sur la procédure à suivre pour obtenir une autorisation écrite
sous la forme d’une licence, rendez-vous à l’adresse https://ibo.org/become-an-ib-school/
ib-publishing/licensing/applying-for-a-license/.
Todos los derechos reservados. No se podrá reproducir ninguna parte de este producto
de ninguna forma ni por ningún medio electrónico o mecánico, incluidos los sistemas de
almacenamiento y recuperación de información, sin la previa autorización por escrito del
IB. Además, la licencia vinculada a este producto prohíbe el uso de todo archivo o
fragmento seleccionado de este producto. El uso por parte de terceros —lo que incluye,
a título enunciativo, editoriales, profesores particulares, servicios de apoyo académico o
ayuda para el estudio, colegios preparatorios, desarrolladores de aplicaciones y
entidades que presten servicios de planificación curricular u ofrezcan recursos para
docentes mediante plataformas digitales—, ya sea incluido en tasas o no, está prohibido
y constituye un delito.
En este enlace encontrará más información sobre cómo solicitar una autorización por
escrito en forma de licencia: https://ibo.org/become-an-ib-school/ib-publishing/licensing/
applying-for-a-license/.
Computer science
Standard level
Paper 2
6 May 2024
1 hour
Instructions to candidates
y Do not open this examination paper until instructed to do so.
y Answer all of the questions from one of the options.
y The maximum mark for this examination paper is [45 marks].
Option Questions
Option A — Databases 1–3
Option B — Modelling and simulation 4–6
Option C — Web science 7–9
Option D — Object-oriented programming 10 – 13
2224 – 6908
19 pages © International Baccalaureate Organization 2024
–2– 2224 – 6908
Option A — Databases
1. Environmental systems and societies (ESS) students are collecting data about the plant
species found on sand dunes as part of their internal assessment. The data is collected
from 10 sites using a paper form (Figure 1).
The form shown in Figure 1 is used to input data into the Environment database.
Aspect: South
Gradient: 10
Comments: None
Marram grass 0
Sea holly 0
Sea spurge 0
Sea buckthorn 0
Gorse ✔ 40
Blackthorn ✔ 40
(i) Species[1]
(ii) Gradient[1]
(b) Outline one way that data validation could be carried out on the gradient attribute. [2]
Plant
6 Gorse 📎(0)
7 Blackthorn 📎(0)
Site
Turn over
–4– 2224 – 6908
Distribution
Plant_ID Site_ID Date
1 1 14/10/2019
2 1 14/10/2019
… … …
… … …
6 7 14/10/2019
7 7 14/10/2019
… … …
6 9 14/10/2019
… … …
6 7 21/10/2019
7 7 21/10/2019
(c) Construct an entity relationship diagram (ERD) for the Plant, Site and Distribution tables. [3]
(d) Outline why a composite primary key is used for the Distribution table. [2]
(e) Identify the steps to create a query to calculate the total number of sites where gorse
has been found from the samples carried out on 14 October 2019. [4]
(f) Explain how data consistency can be maintained in the Environment database. [3]
(Option A continued)
2. The Bucharesti School website allows parents to login and select school transportation for
their children. If they select the school bus, they will have to pay for this service at the end
of the month.
(a) Identify the steps that take place in a transaction when a parent attempts to pay for the
school bus at the end of a month. [3]
(b) Explain how the database management system (DBMS) prevents a record being
updated by two parents simultaneously. [3]
(c) Identify two roles of the database administrator at Bucharesti School. [2]
(d) Outline two ways that a database management system (DBMS) can be used to ensure
the students’ personal data remains secure. [4]
(e) Explain how the developers of the Bucharesti School database can ensure that it has
been designed ethically. [6]
Turn over
–6– 2224 – 6908
(Option A continued)
… … … … … …
… … … … … …
… … … … … …
(b) Outline why the data type for the Olympic Record attribute (OlymRec) cannot be
an integer. [2]
ATHLETICS
(Event, Type, SubType, Gender, OlymRec, WldRec)
(c) Construct the 2nd Normal Form (2NF) of the unnormalized ATHLETICS relation
shown above. [5]
(d) Outline why databases are normalized from 2nd normal form (2NF) to 3rd normal
form (3NF). [2]
End of Option A
–7– 2224 – 6908
4. A company designs new kitchens for customers. It has a shop that shows examples of the
kitchen cabinets, sinks, wall tiles and floor tiles that can be included in the new kitchen.
When customers have chosen the items they would like for the new kitchen, a simulation is
set up to show how these items would look.
(a) State three variables that could be used for this simulation. [3]
(b) Outline two rules that would need to be applied for this simulation to be created within
the constraints of the customer’s kitchen. [4]
(c) Outline two factors that would impact on the reliability of this simulation. [4]
(d) Discuss the advantages and disadvantages of using simulation to design a fitted kitchen. [5]
5. A real estate agent makes use of electronic brochures to send to potential house buyers.
These brochures contain details of the properties, including sets of photographs of the rooms
and the different views from the property.
(a) Outline the impact in terms of memory requirements on the potential house buyer’s
device when viewing a brochure. [2]
The real estate agent decides to improve their brochures by using animated ‘walk-throughs’.
(b) State the name of the process that relates the original photographs of the properties to
the animated ‘walk-throughs’. [1]
(c) Explain how ray tracing may be beneficial to the production of the real estate
agent’s animations. [3]
(d) Explain the ethical considerations for the use of animated ‘walk-throughs’ in the
new brochures. [4]
Turn over
–8– 2224 – 6908
(Option B continued)
6. A supermarket has set up a spreadsheet model to compare its sales for each quarter during
the financial year 2020 to 2021.
A B C D E F G H I
1 Sales (in thousands of units)
2
Jul–Sept
Apr–Jun
Oct–Dec
Jan–Mar
average
Highest
Quarter
quarter
Lowest
quarter
Whole
year
2020 - 2021
Oct–Dec
Jan–Mar
average
Highest
Quarter
quarter
Lowest
quarter
Whole
year
2020 - 2021
16 Bakery
17 Dairy
18 Delicatessen
The manager of the supermarket plans to use this model in meetings with the eight
department heads so that they can set targets for future sales.
(a) Identify the functions or formulas that could be used in the cells:
(i) F3[1]
(ii) G3[1]
(iii) H3[1]
(iv) I3[1]
This model needs to be developed to set targets for increasing the sales over the next
financial year for the bakery department. The target percentage increase can be changed
within the model.
(b) Design a spreadsheet model that will calculate the target sales for the bakery department.
The model will display the updated sales targets for each quarter, the whole year and
the average per quarter. The initial sales target is an increase of 7 %. [5]
(c) Describe one limitation of this model for predicting future profits. [2]
Turn over
– 10 – 2224 – 6908
The supermarket uses a second model to predict future sales increases based on previous
performance. The spreadsheet in Figure 5 is part of that model. For the year 2020 to 2021,
it shows the:
y revenue for sales taken by each department in each quarter
y cost of purchasing the stock for the supermarket
y utility costs of running the store
y staff costs.
A B C D E F G H I
1 Revenues, costs and profits ($ * 1000)
2
Whole year
2020–2021
Jul–Sept
Apr–Jun
Oct–Dec
Jan–Mar
average
Highest
Quarter
quarter
Lowest
quarter
3
4 Revenues
5 Bakery 23.4 25.4 36.8 25.4 111.1 27.8 36.8 23.4
6 Dairy 17.4 18.8 20.6 18.5 75.3 18.8 20.6 17.4
7 Delicatessen 23.1 29.7 21.6 23.1 97.5 24.4 29.7 21.6
8 Frozen 29.5 27.7 26.9 25.5 109.6 27.4 29.5 25.5
9 Fruit 17.4 21.5 29.4 26.6 94.9 23.7 29.4 17.4
10 Grocery 77.6 57.8 92.4 75.5 303.3 75.8 92.4 57.8
11 Meat 40.5 42.6 53.1 28.5 164.7 41.2 53.1 28.5
12 Seafood 56.0 37.0 75.1 38.5 206.6 51.7 75.1 37.0
13 Total 284.9 260.5 356.0 261.6 1163.0 290.8 366.7 228.5
14
15 Wholesale costs
16 Bakery 12.2 13.2 19.1 13.2 57.7 14.4 19.1 12.2
17 Dairy 9.9 10.7 11.8 10.6 43.0 10.8 11.8 9.9
18 Delicatessen 12.6 16.2 11.8 12.6 53.2 13.3 16.2 11.8
19 Frozen 15.3 14.4 14.0 13.3 56.9 14.2 15.3 13.3
20 Fruit 9.0 11.2 15.3 13.8 49.3 12.3 15.3 9.0
21 Grocery 48.4 36.0 57.6 47.1 189.1 47.3 57.6 36.0
22 Meat 35.8 37.6 46.9 25.1 145.5 36.4 46.9 25.1
23 Seafood 33.5 22.1 44.9 23.0 123.4 30.9 44.9 22.1
24 Total 176.7 161.4 221.3 158.7 718.1 179.5 227.1 139.4
25 Other costs
26 Utilities 9.3 11.5 12.6 12.3 45.7 11.4 12.6 9.3
(Option B continues on the following page)
– 11 – 2224 – 6908
A B C D E F G H I
27 Staff 76.8 79.3 96.3 81.2 333.6 83.4 96.3 76.8
28 Total 86.0 90.8 108.9 93.6 379.3 94.8 108.9 86.0
29
30 Total costs 262.7 252.3 330.2 252.3 1097.4 274.4 335.9 225.5
31
32 Profit 22.2 8.2 25.8 9.4 65.6 16.4 30.7 3.1
(i) B30[1]
(ii) B32[1]
The names of the departments have been stored in a one-dimensional array, DEPARTMENT[].
It has been decided to use a number of parallel one-dimensional arrays to store the quarterly
figures and the annual totals for each department.
(e) Construct the pseudocode required to enter the data for each department for
each separate quarter, calculate the annual totals and store the data into suitably
named arrays. [6]
End of Option B
Turn over
– 12 – 2224 – 6908
7. The web browser shown in Figure 6 includes a feature that enables the user to inspect the
source code.
https://www.educationalsite.org/assets/home.html
Educational Resources
<doctype html>
<html>
<head></head>
<body>
<h1>Mother tongue Languages</h1>
<table width="500" border=1>
<tr>
<td>Mother Tongue</td>
</tr>
<tr>
<td> <p id="languages"></p></td>
</tr>
</table>
<script>
(c) Outline why the web page in Figure 6 is a static web page. [2]
(d) Explain why the support of client-side scripting languages is a key function of
web browsers. [3]
A user wants to access another website and enters its URL into the address bar.
(f) Describe how the domain name service (DNS) enables the user to access the new site. [4]
A user wishes to download a video resource from a web-based host to their smartphone.
The site offers a lossy download option and lossless download option. It was recommended
that the user uses the lossy compression option for this download.
Turn over
– 14 – 2224 – 6908
(Option C continued)
8. While working on an assignment task for History of the Americas, Brooke enters a question
into a search engine (Figure 7).
https://searchengine.example.com
Search Engine
Another student indicated that Brooke would obtain better results using keywords rather than
a search phrase.
(a) Outline why keywords would be used in a search rather than a phrase. [2]
Web crawling indexes webpages in the search engine’s database (Figure 8). The two web
crawling methods used are a breadth-first crawl and a depth-first crawl.
B E H K
C D F G I J L M
(b) In Figure 8, A has not been previously visited. State the first three webpages visited in
a breadth-first search. [1]
(c) Outline one reason why search engines use a breadth-first search. [2]
As the web crawler traverses the pages in a website it collects data. This is used to form the
metrics data for search rankings.
Many web developers attempt to optimize the search results for their site.
(e) Explain the impact for DP History students such as Brooke if the web developer uses
black hat search engine optimization techniques. [4]
Turn over
– 16 – 2224 – 6908
Blank page
– 17 – 2224 – 6908
(Option C continued)
9. ARPANET was developed as a project by the American military. It became the technical
foundation for the internet. Figure 9 is a representation of ARPANET in 1974.
Hawaii
London
(a) Outline one reason why ARPANET was developed as a distributed network. [2]
The original ARPANET used cable networks within the US. When linking to Hawaii and the
United Kingdom it used a satellite link. The network consisted of connected mainframe
computers hosting servers that had a number of connected terminals (clients).
The nature of computing has evolved from client-server architecture to peer-2-peer and
cloud computing.
(d) To what extent have open standards and interoperability supported the decentralization
of the web? [6]
End of Option C
Turn over
– 18 – 2224 – 6908
10. A car rental company has offices in cities in Spain and Portugal. It manages its cars as
a large, unsorted collection of rental objects that is accessed by a Java program.
The following UML diagram describes the current main Rental class. Fuel type and
transmission type were chosen to be Boolean because they have two choices: petrol
or diesel for fuel type, and manual or automatic for transmission type.
The brand and the model of the car are stored together as one string brandModel.
Typically the company has many cars of the same brand and model.
(e) Outline one change that needs to be made to class Rental due to this development. [2]
Based on this Rental class, the program defines several other classes: Car, Bus and
Van, each with their own characteristics. For example, the class Car adds the attribute
numberOfDoors to the class Rental.
(g) Construct the code for the class Car without having to duplicate all the attributes and
methods from the class Rental. The default constructor of the class Rental should
be overridden to also assign the value 4 to numberOfDoors. No other constructors
are required. [3]
(Option D continued)
11. (a) Identify the OOP feature that was used to declare the Car class. [1]
12. All Car objects have been read into a large unsorted array called allCars.
This method should take the array allCars as a parameter and select Car objects from
allCars so that every available brandModel is presented only once.
You may assume that there are never more than 100 different types of cars (as identified by
the variable brandModel).
(b) Construct the code for the method findBrandModels() that will take the array
allCars as a parameter. It must return a Car array that contains every brandModel
that is available without duplication. [8]
A customer wants to see which different types of cars are available. The criteria are it must
be a petrol car with automatic transmission and cost less than 35 euros per day.
(c) Without writing code, outline the steps needed for a method to perform this query and
present the results to the customer. [5]
13. The car rental company also has a database of customers. For each customer it stores an
object with personal data such as their ID, name and address.
This Customer object includes the history of the cars they have rented and the car they are
currently renting (if any).
(a) Draw the relationship between Customer and Car objects. [1]
A suggestion has been made to modify the Rental class to include customerID.
The intention is to make it easier to find the customer who has a certain car.
(c) Explain the ethical obligations for programmers when developing a customer database. [5]
End of Option D
Disclaimer:
Content used in IB assessments is taken from authentic, third-party sources. The views expressed within them belong to their
individual authors and/or publishers and do not necessarily reflect the views of the IB.
References:
All other texts, graphics and illustrations © International Baccalaureate Organization 2024