100% found this document useful (1 vote)
816 views21 pages

Computer Science Paper 2 SL-5

Uploaded by

vardanbajaj
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
100% found this document useful (1 vote)
816 views21 pages

Computer Science Paper 2 SL-5

Uploaded by

vardanbajaj
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/ 21

© International Baccalaureate Organization 2024

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

© Organisation du Baccalauréat International 2024

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

© Organización del Bachillerato Internacional, 2024

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

Zone A morning Zone B morning Zone C morning

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.

Figure 1: An example of a data collection form.

FIELD STUDY CENTRE [LOGO]

Survey date: 14/10/2019

Sample site: 9 Established dune, south facing

Aspect: South

Gradient: 10

Comments: None

Species Present Coverage %

Marram grass 0

Sand couch grass 0

Sea holly 0

Sea spurge 0

Sea buckthorn 0

Gorse ✔ 40

Blackthorn ✔ 40

(Option A continues on the following page)


–3– 2224 – 6908

(Option A, question 1 continued)

(a) State the data type for:

(i) Species[1]

(ii) Gradient[1]

(b) Outline one way that data validation could be carried out on the gradient attribute. [2]

Three of the tables in the Environment database are shown in Figure 2:

Figure 2: Three of the tables in the Environment database

Plant

Plant_ID Species Image More fields

1 Marram grass 📎(0)

2 Sand couch grass 📎(0)

3 Sea holly 📎(0)

4 Sea spurge 📎(0)

5 Sea buckthorn 📎(0)

6 Gorse 📎(0)

7 Blackthorn 📎(0)

Note: The image is stored in the database as an attachment.

Site

Site_ID Location Aspect Gradient

1 Seaward facing foreshore West 8.2

Seaward facing upper slope of


2 West 8.0
dune closest to the sea

Landward side of dune closest


3 East 7.9
to the sea

4 First slack area between dunes None 7.6

Seaward facing mid slope of


5 West 7.8
dune second closest to the sea

(Option A continues on the following page)

Turn over
–4– 2224 – 6908

(Option A, question 1 continued)

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 continues on the following page)


–5– 2224 – 6908

(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]

The students’ personal details must be securely stored in the database.

(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]

(Option A continues on the following page)

Turn over
–6– 2224 – 6908

(Option A continued)

3. The ATHLETICS table contains information about athletics events.

Figure 3: The ATHLETICS table

Event Type SubType Gender OlymRec WldRec

100 Track Run M 9.63 9.58


Track Run F 10.62 10.49

200 Track Run M 19.30 19.19


Track Run F 21.34 21.34

… … … … … …

Long Jump Field Jump M 8.90 8.95


F 7.40 7.52

… … … … … …

Shot Put Field Throw M 22.52 23.12


Field Throw F 22.41 22.63

… … … … … …

Heptathlon Track  Field Multi F 7291.0000 7291.0000

Decathlon Track  Field Multi M 8893.0000 9126.0000

(a) Outline one reason why databases are normalized. [2]

(b) Outline why the data type for the Olympic Record attribute (OlymRec) cannot be
an integer. [2]

The table can also be represented as:

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

Option B — Modelling and simulation

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]

(Option B continues on the following page)

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.

This model, for each of the eight departments, shows the:


y quantity of units sold each quarter
y average units sold per quarter
y highest quarterly sales
y lowest quarterly sales.

Figure 4: The supermarket’s sales by department

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

3​ Bakery 9.4 10.2 14.7 10.2 44.4 11.1 14.7 9.4


4​ Dairy 9.7 10.4 11.5 10.3 41.8 10.5 11.5 9.7
5​ Delicatessen 6.1 7.8 5.7 6.1 25.7 6.4 7.8 5.7
6​ Frozen 7.4 6.9 6.7 6.4 27.4 6.9 7.4 6.4
7​ Fruit 11.6 14.3 19.6 17.7 63.3 15.8 19.6 11.6
8​ Grocery 64.7 48.1 77.0 69.2 259.0 64.8 77.0 48.1
9​ Meat 8.1 8.5 10.6 5.7 33.0 8.3 10.6 5.7
10​ Seafood 13.2 8.7 17.7 9.1 48.6 12.2 17.7 8.7
11​
12​ Target increase (%)
13​
14​ Target sales (in thousands of units)
15​
Jul–Sept
Apr–Jun

Oct–Dec

Jan–Mar

average

Highest
Quarter

quarter

Lowest
quarter
Whole
year

2020 - 2021

16​ Bakery
17​ Dairy
18​ Delicatessen

(Option B continues on the following page)


–9– 2224 – 6908

(Option B, question 6 continued)

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]

(Option B continues on the following page)

Turn over
– 10 – 2224 – 6908

(Option B, question 6 continued)

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.

All values have been rounded to the nearest dollar.

Figure 5: The supermarket’s sales and costs by department.

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

(Option B, question 6 continued)

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

(d) Identify the formulas used in the cells:

(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

Option C — Web science

7. The web browser shown in Figure 6 includes a feature that enables the user to inspect the
source code.

Figure 6: The source code for the web page

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>

var subjects = ["English","Spanish","French","Hindi","Mandarin","Japan


ese","Korean"]:
var text = " " ;
for (var i=0; subjects[i];i++) {
text += subjects[i] + "<br>" ;
}
document.getElementById("languages").InnerHTML = text;

// document.getElementById(ID).InnerHTML can be used to set the HTML for


the content of a webpage element with id = ID //
</script>
</body>
</html>

(a) Outline why the URL in Figure 6 is a “Full URL”. [2]

(b) Sketch the output of the code in Figure 6. [3]

(c) Outline why the web page in Figure 6 is a static web page. [2]

(Option C continues on the following page)


– 13 – 2224 – 6908

(Option C, question 7 continued)

The web page in Figure 6 uses Javascript elements.

(d) Explain why the support of client-side scripting languages is a key function of
web browsers. [3]

(e) Distinguish between a protocol and a standard. [2]

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.

(g) Explain why lossy compression is used in mobile computing. [4]

(Option C continues on the following page)

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

Figure 7: The Ultimate Search Engine

https://searchengine.example.com
Search Engine

Ultimate Search Engine

Did George Washington have a diary?

Advanced search options

The search returns 173 000 results in 0.043 seconds.

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]

(Option C continues on the following page)


– 15 – 2224 – 6908

(Option C, question 8 continued)

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.

Figure 8: Webpages in the search engine’s database

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.

(d) Identify two features of the PageRank algorithm. [2]

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]

(Option C continues on page 17)

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.

Figure 9: The ARPANET network 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).

(b) Outline one advantage of using a client-server architecture. [2]

The nature of computing has evolved from client-server architecture to peer-2-peer and
cloud computing.

(c) Compare peer-2-peer and cloud computing. [4]

Decentralization of the web is partly a result of open standards, interoperability and


distributed networks.

(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

Option D — Object-oriented programming

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.

Rental example Rental object


- numberPlate: String 9876 BMW
- brandModel: String Citrault Polo
- year: integer 2018
- rentalClass: char B
- pricePerDay: real 28.78
- fuelType: boolean true
- transmissionType: boolean false
+ default constructor
+ accessor and mutator methods

(a) Outline the general nature of an object. [2]

(b) State one mutator method to be included in the class Rental.[1]

(c) Construct the code for the accessor method getBrandModel().[3]

(d) Outline one purpose of a default constructor. [2]

The company is buying new electric cars and hybrid cars.

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

(f) State the relationship between Rental and Car.[1]

(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 continues on the following page)


– 19 – 2224 – 6908

(Option D continued)

11. (a) Identify the OOP feature that was used to declare the Car class. [1]

(b) Explain the benefits of the feature identified in part (a).[3]

(c) Identify the two other features of OOP. [2]

(d) Describe one advantage of modularity in program development. [2]

12. All Car objects have been read into a large unsorted array called allCars.

A method is needed to show customers the range of available cars.

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

(a) Define the term parameter variable.[2]

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

(b) Describe in terms of dependencies why this suggestion is inappropriate. [2]

(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:

9. Semaforo GMS. Arpanet in the 1970s.png. https://commons.wikimedia.org/wiki/File:Arpanet_in_the_1970s.png. Licensed


under CC BY-SA 4.0 DEED https://creativecommons.org/licenses/by-sa/4.0/deed.en. Image adapted.

All other texts, graphics and illustrations © International Baccalaureate Organization 2024

You might also like