N5 Computing Science
N5 Computing Science
National
Qualications Mark
2024
X816/75/01 Computing Science
MONDAY, 20 MAY
1:00 PM – 2:30 PM *X8167501*
Date of birth
Day Month Year Scottish candidate number
Total marks — 80
SECTION 1 — Software design and development, and Computer systems — 55 marks
Attempt ALL questions.
Attempt EITHER Section 2 OR Section 3
SECTION 2 — Database design and development — 25 marks
SECTION 3 — Web design and development — 25 marks
You may use a calculator.
Show all workings.
Write your answers clearly in the spaces provided in this booklet. Additional space for answers is
provided at the end of this booklet. If you use this space you must clearly identify the question
number you are attempting.
Use blue or black ink.
Before leaving the examination room you must give this booklet to the
Invigilator; if you do not, you may lose all the marks for this paper.
©
*X816750101*
A/HTP
MARKS DO NOT
WRITE IN
THIS
MARGIN
SECTION 1 — SOFTWARE DESIGN AND DEVELOPMENT, AND COMPUTER SYSTEMS
— 55 marks
Attempt ALL questions
Complete the table below to state which types of variable should be used. 2
chocolateName
inStock Boolean
numberOfChocolatesInBox
*X816750102*
page 02
MARKS DO NOT
WRITE IN
THIS
MARGIN
3. Explain why it may be necessary to return to the implementation stage of an
iterative development process after the testing stage. 1
[Turn over
*X816750103*
page 03
MARKS DO NOT
WRITE IN
THIS
MARGIN
5. A competition was run to suggest names for a new bridge. The 20 most popular
bridge names have been identified and stored.
(a) State the most suitable data structure used to store the bridge names. 1
(b) State the predefined function that should be used to select any one of the 20
stored bridge names as the winner. 1
0.18563 × 104
(a) Identify the mantissa and exponent in the above floating‑point representation. 2
Mantissa
Exponent
(b) During the trip Mateo uses his smartphone to track his route.
Describe how he could reduce the energy use of his device to ensure the
battery lasts as long as possible. 1
*X816750104*
page 04
MARKS DO NOT
WRITE IN
THIS
MARGIN
7. The program code below protects the rechargeable battery in an electric
toothbrush.
…
Line 67 SET brushstop TO FALSE
Line 68 WHILE brushstop = FALSE DO
Line 69 SET battery TO <percentage of power left>
Line 70 SET temperature TO <temperature of battery>
Line 71 IF battery < 3 OR temperature > 45 THEN
Line 72 SET brushstop TO TRUE
Line 73 END IF
Line 74 END WHILE
Line 75 <switch toothbrush off>
…
8. State how many extended ASCII text characters can be stored using 80 bits. 1
[Turn over
*X816750105*
page 05
MARKS DO NOT
WRITE IN
THIS
MARGIN
9. A campsite booking system is being developed to calculate the cost of a stay at £35
per night, per person. The cost will be displayed to the user before they confirm
the booking. The system will ask users for their name, number of people, arrival
date and length of stay.
Input
Process
…
Line 7 RECEIVE name FROM (STRING) KEYBOARD
Line 8 RECEIVE numberOfPeople FROM (INTEGER) KEYBOARD
Line 9 RECEIVE arrival FROM (STRING) KEYBOARD
Line 10 RECEIVE nightsStaying FROM (INTEGER) KEYBOARD
Line 11 <calculate cost of stay>
Line 12 SEND "The cost of your stay is £" & cost TO DISPLAY
…
Using a programming language of your choice, write the code for Line 11. 3
*X816750106*
page 06
MARKS DO NOT
WRITE IN
THIS
MARGIN
9. (continued)
(c) To pay a deposit, users will have to provide bank account details.
State how this information could be transferred securely to the booking
system. 1
(d) The number of guests who stayed at the campsite each night in 2023 is stored
in the array guests.
Index 0 1 2 … 364
Value 271 240 153 … 87
The campsite want to know the total number of guests who stayed at the site
in 2023.
Using a programming language of your choice, write the code to calculate this
total. 4
Total = 0
for i in index:
Total += value
[Turn over
*X816750107*
page 07
MARKS DO NOT
WRITE IN
THIS
MARGIN
9. (continued)
*X816750108*
page 08
MARKS DO NOT
WRITE IN
THIS
MARGIN
10. An event company organises children’s parties. They would like a program to help
calculate the costs of parties.
Part of the structure diagram design is shown below.
yes no yes no
Cake Cake Start loop for Venue Venue
= £15.00 = £0 each child = £0 = £50
Get dietary
requirements
(a) State another design technique that could be used to design this program. 1
[Turn over
*X816750109*
page 09
MARKS DO NOT
WRITE IN
THIS
MARGIN
10. (continued)
(d) A personalised party sweatshirt costs £12, with each character of the
personalised message costing an additional 25p.
(i) Using a design technique of your choice, design a program to store the
user’s message and output the total cost of the sweatshirt. 4
(ii) The washing label on the sweatshirt has the following symbol.
Identify an object used to make this symbol and one of its attributes. 2
Object
Attribute
(e) Once the program is implemented, state which part of the processor will
execute the following tasks. 2
Calculate cost
*X816750110*
page 10
MARKS DO NOT
11. Edge Races are developing a program to process information on races with multiple WRITE IN
THIS
stages. MARGIN
stage 1
Race one stage 2
start
Stage Distance (km)
1 19.9
finish
2 6.5
3 35.2 stage 3
stage 4
4 20.0
*X816750111*
(b) The following lines of code are written to input the distance for each stage of
‘Race one’.
…
Line 6 FOR stage FROM 0 TO 3 DO
Line 7 RECEIVE distance FROM KEYBOARD
…
Changes should be made to the code above to ensure that any number of
stages could be processed.
Describe two changes that would be required. 2
Change 1
Change 2
*X816750112*
page 12
MARKS DO NOT
WRITE IN
THIS
MARGIN
11. (continued)
…
Line 25 <calculate the total distance for the race>
Line 26 IF totalDistance < 25 THEN
Line 27 SET race TO "beginner"
Line 28 END IF
Line 29 IF totalDistance >= 25 OR totalDistance <=100 THEN
Line 30 SET race TO "intermediate"
Line 31 END IF
Line 32 IF totalDistance > 100 THEN
Line 33 SET race TO "advanced"
Line 34 END IF
Line 35 SEND race TO DISPLAY
…
*X816750113*
(e) The average stage distance for each race is calculated and stored in the
variable avgDistance.
(i) Using a programming language of your choice, write the code to store
the average to 1 decimal place. 2
(ii) The average stage distance should be displayed, as shown below for
‘Race one’.
[END OF SECTION 1]
*X816750114*
page 14
[Turn over for SECTION 2
*X816750115*
page 15
MARKS DO NOT
WRITE IN
THIS
MARGIN
SECTION 2 — DATABASE DESIGN AND DEVELOPMENT — 25 marks
Attempt ALL questions
Add Photo
Jamie
Jones
07895582319
Q W E R T Y U I O P
A S D F G H J K L
Z X C V B N M
State the attribute type that would be used to store the data identified by the
arrow above. 1
*X816750116*
page 16
MARKS DO NOT
WRITE IN
THIS
MARGIN
14. Teams take part in a technology competition. Their details are stored in a table
called Team. The sorted output below was produced by executing a query.
(a) Complete the SQL statement used to produce this sorted output. 2
FROM Team
ORDER BY
(b) Brainy Bunch from schoolID 214 has been disqualified from the competition.
Write the SQL statement to remove them from the table. 2
[Turn over
*X816750117*
page 17
MARKS DO NOT
WRITE IN
THIS
MARGIN
15. The Games Lab is a video game testing company that programmers can send games
to for testing. Each game is allocated to a tester who works on several different
games. Testers are based in three offices — Scotland, France and Australia — and
only accept games rated 12A, 15 and 18.
gameID name
gameName
testerID
rating
Game Tester
testerID
contactNo
programmer
multiplatform
*X816750118*
page 18
MARKS DO NOT
WRITE IN
THIS
MARGIN
15. (continued)
The Game table is implemented. Some of the data it currently stores is shown
below.
Game
… … … … … …
The game ‘Water Rage’ has been reclassified as an 18 rating. The following SQL
statement was implemented to make this change.
UPDATE Game
SET rating = "18"
WHERE programmer = "CodeQueen"
(b) Explain why the SQL statement above would give an unexpected result. 1
[Turn over
*X816750119*
page 19
MARKS DO NOT
WRITE IN
THIS
MARGIN
16. A database stores data on a local netball league. The Club table stores data of the
clubs that play in the league. The Player table stores data on each player.
Sample data from each table is shown below.
Club
… … … … …
Player
… … … … … …
(a) Explain the purpose of the foreign key clubID in the Player table. 1
*X816750120*
page 20
16. (continued) MARKS DO NOT
WRITE IN
THIS
MARGIN
(b) Design a query that could be used to create a list of names and the division for
Goal keepers that are over 30 years old. 4
Field(s)
Table(s)
Search Criteria
(c) (i) The netball league wants a list of players who meet at least one of the
following criteria:
• train in Lanarkshire
• play for a team in division 2.
Complete the SQL query below. 4
FROM
WHERE
[END OF SECTION 2]
*X816750121*
*X816750122*
page 22
SECTION 3 — WEBSITE DESIGN AND DEVELOPMENT — 25 marks MARKS DO NOT
WRITE IN
THIS
Attempt ALL questions MARGIN
Final Puzzle
Puzzle 1
*X816750123*
clubLogo.jpg
*X816750124*
page 24
MARKS DO NOT
WRITE IN
THIS
MARGIN
19. Gone Away travel is a holiday booking website.
Below is the home page for the website.
https://www.goneawaytravel.co.uk
Naples
Copenhagen
Egypt
(a) Gone Away travel have added flags to the images on their home page. These
contain a white background that must be removed.
State the reason why a PNG file format would be more suitable than a JPEG
file format. 1
[Turn over
*X816750125*
page 25
19. (continued) DO NOT
WRITE IN
THIS
MARGIN
(b) The following HTML and CSS is for a web page containing information about a trip
to Naples.
style.css
body{
background-color:lightblue;
}
img{
height:200px;
width:250px;
}
h1{
font-family:Helvetica;
font-size:14px;
}
div{
background-color:white;
}
#city{
text-align:center;
font-size:20px;
}
p{
text-align:center;
font-size:12px;
}
naples.html
<!doctype HTML>
<html>
<head>
<title>Gone Away Travel - Naples</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1>Gone Away Travel</h1>
<h1 id="city">Naples</h1>
<p>Come visit the lovely Naples, the third largest city in
Italy. Home to the best pizza in the world. View our
pictures below to help make up your mind.</p>
<div>
<img src="Media/naples1.png">
<p class="description">Stunning view of the Naples bay</p>
</div>
<div>
<img src="Media/naples2.png">
<p class="description">One of the many food markets in
Naples</p>
</div>
</body>
</html>
*X816750126*
page 26
MARKS DO NOT
WRITE IN
THIS
MARGIN
19. (b) (continued)
(i) The description of each photograph is to be right aligned, use Arial font
and be the same size as the other paragraphs on the page.
Write a single CSS rule that would only style the descriptions. 3
������������������������������������������������������ {
�����������������������������������������������������������������������
�����������������������������������������������������������������������
(ii) The hyperlink below can be found on the Naples information page.
<a href="www.NaplesCity.co.uk">Official Naples city
guide</a>
State the type of addressing used in the hyperlink. 1
[Turn over
*X816750127*
page 27
MARKS DO NOT
WRITE IN
THIS
MARGIN
19. (continued)
(c) A video tour of Naples will be added to the web page. All media files for the
website are stored in a folder called ‘Media’ as shown below.
>
Name
copenhagen.html
egypt.html
naples1 naples2 naplesTour.mp4
goneawayhomepage.html
naples.html
Media
Using this structure, complete the following code so that the video
naplesTour.mp4 is displayed on the naples.html page with the following
dimensions. 3
300 px
naplesTour.mp4
350 px
<source src=���������������������������������������������������������������������������������������������
type = "video/mp4">
</video>
*X816750128*
page 28
MARKS DO NOT
WRITE IN
THIS
MARGIN
19. (continued)
(d) Gone Away Travel would like to improve their website based on user feedback.
A sample of the feedback is shown below.
‘It would be fun to listen to clips of useful local phrases for each holiday
location.’
‘I felt really bored while using your website. Booking a holiday should be
fun.’
‘I got stuck on the Naples page!’
Identify one functional requirement that should be added to the website based
on the feedback above. 1
[Turn over
*X816750129*
page 29
MARKS DO NOT
WRITE IN
THIS
MARGIN
20. Blockland theme park is developing a new website for visitors.
The following code is used to create the home page.
<!doctype html>
<html>
<head>
<title>Blockland Home Page</title>
<style>
body{background-color:lightblue;font-family:arial;}
img{height:150px; width:150px;}
h1{font-family:helvetica; font-size:24pt; text-align:center;}
.openSection{text-align:left;}
div{background-color:white; font-size:12pt;}
</style>
</head>
<body>
<img src="blocklandLogo.jpg" alt="Blockland Logo">
<h1>Welcome to Blockland!</h1>
<div>
<h1 class="openSection">Ultimate Day Out</h1>
<p>With an amazing themed room to suit every Block Lover including
rapid race cars, terrifying tarantulas and spectacular space there
is something for the whole family.</p>
<a href="parkRides.html">Click here to view the rides in the
park</a>
</div>
(a) Describe how the ‘Ultimate Day Out’ heading, including any background colour,
will be displayed in a browser. 4
*X816750130*
page 30
MARKS DO NOT
WRITE IN
THIS
MARGIN
20. (continued)
…
<p>New Rides</p>
<ul>
<li><a href="blockCars.html">The Block Cars</a></li>
<li>The Mystical Forest</li>
<li>The Lizard</li>
</ul>
…
[Turn over
*X816750131*
page 31
20. (continued) MARKS DO NOT
WRITE IN
THIS
MARGIN
(c) The page for a new ride called ‘The Block Cars’ is shown below. When the user
moves the cursor over the image of the ride another image showing the
opening date is revealed.
https://www.blockland.co.uk/blockcars https://www.blockland.co.uk/blockcars
Coming
16th October
2024
It's time for everyone to become It's time for everyone to become
drivers at the new exciting Blockland drivers at the new exciting Blockland
block cars! After a brief road block cars! After a brief road
safety video you will be ready to go safety video you will be ready to go
and take the wheel of your very and take the wheel of your very
own electric block car and own electric block car and
drive around the Blockland city. drive around the Blockland city.
(d) Blockland runs a competition that involves guests of the park submitting video
footage they have taken of the rides. A member of staff suggests uploading the
videos to the website.
State what Blockland should do to ensure they comply with the Copyright,
Designs and Patents Act. 1
(e) The website has been tested to ensure that all navigation works as expected
and all the media on the website displays correctly.
Describe one other test that could be carried out on the website. 1
[END OF SECTION 3]
[END OF QUESTION PAPER]
*X816750132*
page 32
MARKS DO NOT
WRITE IN
THIS
MARGIN
ADDITIONAL SPACE FOR ANSWERS
*X816750133*
page 33
MARKS DO NOT
WRITE IN
THIS
MARGIN
ADDITIONAL SPACE FOR ANSWERS
*X816750134*
page 34
[BLANK PAGE]
*X816750135*
page 35
[BLANK PAGE]
Acknowledgement of copyright
Question 1 Trong Nguyen/shutterstock.com
Question 9 (e) arju16/shutterstock.com
Question 17 Everett Collection/shutterstock.com
matryoshka/shutterstock.com
Yarikart/shutterstock.com
Question 19 Sergii Figurnyi/shutterstock.com
Sean Pavone/shutterstock.com
Daily Travel Photos/shutterstock.com
*X816750136*
page 36