N5 Computing-Science QP 2019
N5 Computing-Science QP 2019
National
Qualications Mark
2019
X816/75/01 Computing Science
WEDNESDAY, 22 MAY
9:00 AM – 11:00 AM *X8167501*
Date of birth
Day Month Year Scottish candidate number
SECTION 1 — 25 marks
Attempt ALL questions.
SECTION 2 — 85 marks
Attempt ALL questions.
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/PB
MARKS DO NOT
WRITE IN
THIS
MARGIN
SECTION 1 — 25 marks
Attempt ALL questions
1011 1001
2. Add HTML body, h1 and title opening and closing elements to complete
the code below. 3
<html>
<head>
</head>
< >
< >
</html>
*X816750102*
page 02
MARKS DO NOT
WRITE IN
3. A bank requires a program for loan applications. The user will enter how THIS
MARGIN
much money they want to borrow and the number of monthly repayments.
The user will then be informed how much they must repay each month.
Using the information above, design a user interface for the program. 3
Product
productCode productName manufacturer description
366 Picture Frame Frame Design Silver
439 Crystal Vase Glass Gifts 10cm
316 Glass Bowl Glass Gifts 20cm
285 Scented Candle WaxWorks Vanilla
123 Candle Holder WaxWorks Glass jar
56 Tea Lights WaxWorks Pack of 6
112 Place Mats Zingy Zebra Pack of 5
FROM Product
ORDER BY
*X816750103*
Yes No Yes No
Yes No Yes
(b) The design is tested. For the following inputs state the total displayed. 1
Number of trees – 2
Type of tree – cherry
Size of tree – small
Type of tree – pear
Size of tree – medium
*X816750104*
page 04
MARKS DO NOT
WRITE IN
THIS
MARGIN
5. (continued)
(c) The garden centre is considering selling orange trees for £23·00.
Explain why the design does not need to be changed. 1
[Turn over
*X816750105*
page 05
MARKS DO NOT
WRITE IN
THIS
MARGIN
6. An archaeology club wants a website to provide information about the club
and how to join.
A screenshot of the completed home page is shown below.
Archaeology Club
Welcome to the website for the Archaeology Club. Here you will find links
to the different pages on the site as well as lots of information about
different aspects of archaeology.
*X816750106*
page 06
MARKS DO NOT
WRITE IN
THIS
MARGIN
7. Part of a program requires a user to input the total score
achieved when they roll a pair of six-sided dice.
For example, if the user rolled a 4 and a 1 they would input 5.
(a) State the extreme values required to test this part of the program. 2
Extreme 1
Extreme 2
…
FOR loop FROM 1 TO 100 DO
RECEIVE diceScore FROM KEYBOARD
SET total TO total + diceScore
END FOR
…
[Turn over
*X816750107*
page 07
MARKS DO NOT
WRITE IN
THIS
MARGIN
8. Three records from a database table are shown below.
Book
Explain why the SQL statement will not produce the intended result. 1
*X816750108*
page 08
MARKS DO NOT
WRITE IN
THIS
MARGIN
9. The HTML code below is used to create a web page.
<html>
<head>
<title> French Facts </title>
<style>
h1 {text-align:right}
</style>
<head>
<body>
<h1> France </h1>
<p> Facts about France: </p>
<ul>
<li> Capital: Paris </li>
<li> Population: 67 m </li>
<li> Flag: tricolour </li>
</ul>
</body>
</html>
Draw how this web page will look when viewed in a browser.
Some of the content has already been added. 2
French Facts
*X816750109*
(b) State the part of the processor where these conditions will be evaluated. 1
11. The programming language below uses & to concatenate two strings.
Type
Effect
*X816750110*
page 10
[Turn over for next question
*X816750111*
page 11
DO NOT
WRITE IN
THIS
MARGIN
SECTION 2 — 85 marks
Attempt ALL questions
13. A smart phone app is needed to calculate the cost of electricity. The following
information will be entered by the user.
Electricity Cost
Calculator
Previous Meter Reading
Units 1 3 8 2 3 5 7
Electricity Cost
15007∙11 - 13823∙57 = 1183∙54 units used
1183∙54 units at 2∙835 pence per unit
= £33∙553359
Final bill: £33∙55
*X816750112*
page 12
MARKS DO NOT
WRITE IN
THIS
MARGIN
13. (continued)
(a) Describe two processes that will be carried out by the program. 2
Process 1
Process 2
(ii) State a standard code used to represent text characters and the
number of bits used to store each character. 2
Standard code
Number of bits
(c) State the data types that will be required to store the values of the
following inputs. 2
[Turn over
*X816750113*
page 13
MARKS DO NOT
WRITE IN
THIS
MARGIN
13. (continued)
0·1500711 × 105
Mantissa
Exponent
Line 18
*X816750114*
page 14
MARKS DO NOT
WRITE IN
THIS
MARGIN
13. (continued)
[Turn over
*X816750115*
page 15
MARKS DO NOT
WRITE IN
THIS
MARGIN
14. A youth club plans to create a database to store details of club members.
(a) The youth club leaders have been discussing the requirements of the
new database.
We offer lots of
activities, for example
I need to know the
tennis, football and
details of activity
craft. I need to be able
leaders with a first
to add new activities.
aid qualification.
I need to be able to
display a list of members
listed alphabetically
by town.
Requirement 1
Requirement 2
*X816750116*
page 16
MARKS DO NOT
WRITE IN
THIS
MARGIN
14. (continued)
memForename actName
memSurname firstAider
actLevel
town
Member Activity actCode
dateOfBirth
actLeaderFname
memberNum
actLeaderSurname
[Turn over
*X816750117*
page 17
MARKS DO NOT
WRITE IN
THIS
MARGIN
14. (continued)
(c) State and describe a type of validation that could be applied to the
actLevel attribute. 2
Type of validation
Description
(d) State two implications of the General Data Protection Regulation (GDPR)
for the youth club. 2
Implication 1
Implication 2
*X816750118*
page 18
MARKS DO NOT
WRITE IN
THIS
MARGIN
15. Chill Zone is an online electrical retailer. Fridge freezers need to be added to
its current website.
(a) Analysis was carried out to identify the requirements for the fridge
freezer pages.
Part of the analysis report is shown below.
Using the information from the analysis report above, identify two end-user
requirements of the fridge freezer pages. 2
Requirement 1
Requirement 2
(b) All the images that Chill Zone wants to use are on the fridge freezer
manufacturers’ websites.
(i) Describe what Chill Zone must do to avoid prosecution under the
Copyright, Designs and Patents Act when using these images. 1
[Turn over
*X816750119*
page 19
MARKS DO NOT
WRITE IN
THIS
MARGIN
15. (b) (continued)
(ii) Chill Zone must select one of the fridge freezer images below. Each
image has the same resolution.
Image A Image B
starFrostFree.jpg starFrostFree.gif
800 × 400 800 × 400
Image A advantage
Image B advantage
*X816750120*
page 20
MARKS DO NOT
WRITE IN
THIS
MARGIN
15. (continued)
(c) Some of the HTML code used to create one of the pages on Chill Zone’s
website is shown below.
<html>
<head>
<title> Star Frost Free </title>
<link rel = "stylesheet" type="text/css"
href="ChillStyle.css">
</head>
<body>
<h1> Star Frost Free </h1>
<h2> Images </h2>
<p>View pictures of the new Star Frost Free </p>
<img src="starFrostFreeOpen.jpg"
onmouseover="this.src='starFrostFreeClosed.jpg'">
…
<p>Go to <a href="home.html">Home Page</a> </p>
</body>
</html>
[Turn over
*X816750121*
page 21
MARKS DO NOT
WRITE IN
THIS
MARGIN
15. (c) (continued)
(iii) Explain why the line of code below is included in every page of the
website. 1
(d) State one security precaution that Chill Zone should take to protect its
customers’ payment details when buying online. 1
*X816750122*
page 22
MARKS DO NOT
WRITE IN
THIS
MARGIN
16. A program to control the water temperature inside a washing machine is
being designed. The user will select a wash temperature using the control
panel on the machine.
The program should ensure that the water stays heated at the correct
temperature throughout the wash.
The design for the part of the program that maintains the water temperature
is shown below.
...
No
No
is wash finished?
Yes
...
(a) State the design technique that has been used to design the solution. 1
[Turn over
*X816750123*
page 23
MARKS DO NOT
WRITE IN
THIS
MARGIN
16. (continued)
(ii) State one other construct that has been used in the design and
describe how that construct has been used. 2
Construct
Description
(c) When the wash is finished, the water will drain out. A sensor continuously
detects the amount of water in the machine during the draining process.
When there is no more water in the machine the door will automatically
open.
Using a design technique of your choice, design a solution to this problem. 3
*X816750124*
page 24
MARKS DO NOT
WRITE IN
THIS
MARGIN
16. (continued)
(d) When the program is implemented, the water temperature will be stored
in the memory of the washing machine’s built-in computer.
(i) State the bus used to transfer the stored water temperature to the
processor. 1
(e) The finished program was compiled before it was stored in the washing
machine’s memory.
Explain why this program was compiled. 1
[Turn over
*X816750125*
page 25
MARKS DO NOT
WRITE IN
THIS
MARGIN
17. A company uses a relational database to store details of job vacancies for
current employees. Each employee can apply for only one vacancy.
The tables below show current job vacancies and employees.
Vacancy
jobRef jobTitle department startDate
HR22 Clerk HR 04/06/2019
PD18 Manager Production
AD36 Administrator Admin 30/06/2019
FN42 Finance Officer Finance
PD20 Sales Manager Production 10/07/2019
Employee
appRef jobRef initial surname payGrade drivingLicence cvAttached
325 HR22 CP Martin 2
326 PD18 GL Wood 1
327 HR22 H Patel 3
328 HR22 BF Lee 3
329 AD36 M Aliyev 3
330 PD18 LM Nowak 2
331 HR22 S Patel 1
(a) The start date for two jobs in the Vacancy table has not been entered.
Describe what should be done to ensure that startDate is not left
blank. 1
(b) Design a query to display the job title and names of employees at pay
grade 2 who have applied for any job in the Production department. 4
Field(s)
Table(s)
Search criteria
*X816750126*
page 26
MARKS DO NOT
WRITE IN
THIS
MARGIN
17. (continued)
(c) The pay grade for H Patel should be pay grade 2 and not pay grade 3.
The SQL statement below is written to make the change.
UPDATE Employee
SET payGrade = 3
WHERE surname = "Patel";
(i) Give two reasons why this SQL statement is not fit for purpose. 2
Reason 1
Reason 2
[Turn over
*X816750127*
page 27
17. (continued) MARKS DO NOT
WRITE IN
THIS
MARGIN
(d) The updated tables below show current job vacancies and employees.
Vacancy
jobRef jobTitle department startDate
HR22 Clerk HR 04/06/2019
PD18 Manager Production 28/06/2019
AD36 Administrator Admin 30/06/2019
FN42 Finance Officer Finance 04/07/2019
PD20 Sales Manager Production 10/07/2019
Employee
appRef jobRef initial surname payGrade drivingLicence cvAttached
325 HR22 CP Martin 2
326 PD18 GL Wood 1
327 HR22 H Patel 2
328 HR22 BF Lee 3
329 AD36 M Aliyev 3
330 PD18 LM Nowak 2
331 HR22 S Patel 1
(ii) Describe how this expected output could be used to check that the
SQL statement works correctly. 1
*X816750128*
page 28
MARKS DO NOT
WRITE IN
THIS
MARGIN
18. The Giants basketball team has a website.
All the pages on the site include a link back to the home page. The page
with fixture information also contains an external hyperlink to the
Scottish Basketball League.
Draw the navigational structure for this website. 4
*X816750129*
(b) The upcoming fixtures for July are shown on the webpage below.
Giants - Fixtures
Upcoming Fixtures in July
Giants
Home
Scottish Basketball League
The text ‘Opponent – Date – Venue’ is styled using the following rule.
#fixtures {font-size:14px;
background-color:white;
text-align:left;
color:navy}
*X816750130*
page 30
MARKS DO NOT
WRITE IN
THIS
MARGIN
18. (b) (continued)
(ii) Each away game should have a red background with yellow text.
Write a single style rule that could be used to style all of the away
games. 3
(c) During testing it was found that the external hyperlink shown below did
not navigate to the Scottish Basketball League website.
<a href="ScottishBasketballLeague.html">Scottish
Basketball League </a>
Describe the problem with the addressing that has been highlighted by
this testing. 1
[Turn over
*X816750131*
page 31
MARKS DO NOT
WRITE IN
THIS
MARGIN
18. (continued)
(d) All the video, audio and images used on the Giants website are stored in
a folder called ‘media’ in the following location.
ss
ts MP3
ds MP4
logo.png crowdCheering.mp3 warmUp.mp4
Each page on the site displays an image of the Giants logo in the same
position.
site giants
Name
ss
media
ts
clubInfo
ds
contact
fixtures
home
(i) Identify the graphic file format used to store the image. 1
(ii) Write the code that would be needed to display this image on the
club information page. 2
*X816750132*
page 32
[Turn over for next question
*X816750133*
page 33
MARKS DO NOT
WRITE IN
THIS
MARGIN
19. A fairground game involves
throwing balls through holes in a 50
large wooden board. Each hole
scores different points. 20
5
The game is played using the
following four rules.
30 75 25
(b) The program runs but does not meet the functional requirements stated
in the rules.
(i) State the type of error that has occurred. 1
*X816750134*
page 34
MARKS DO NOT
WRITE IN
THIS
MARGIN
19. (b) (continued)
(ii) The program has been edited as shown, but still breaks rule 3 and
rule 4 of the game.
…
Line 3 DECLARE total INITIALLY 0
Line 4 DECLARE balls INITIALLY 3
Line 5 WHILE total < 50 AND balls > 0 DO
Line 6 RECEIVE ballScore FROM KEYBOARD
Line 7 SET total TO total + ballScore
Line 8 SET balls TO balls − 1
Line 9 END WHILE
Line 10 SEND "Well done! You have won a prize." TO
DISPLAY
*X816750135*
Version A
…
Line 6 RECEIVE ballScore FROM KEYBOARD
Line 7 WHILE ballScore < 0 OR ballScore > 75 DO
Line 8 RECEIVE ballScore FROM KEYBOARD
Line 9 END WHILE
Version B
Line 1 DECLARE possScore INITIALLY
[0,5,20,25,30,50,75]
…
Line 6 DECLARE found AS BOOLEAN INITIALLY false
Line 7 REPEAT
Line 8 RECEIVE ballScore FROM KEYBOARD
Line 9 FOR check FROM 0 TO length(possScore)−1 DO
Line 10 IF possScore[check] = ballScore THEN
Line 11 SET found TO true
Line 12 END IF
Line 13 END FOR
Line 14 UNTIL found
(i) Explain why it would not be appropriate to use the input validation
shown in Version A. 1
(ii) Name the data structure used in line 1 of Version B and state the
data type that it is used to store. 2
*X816750136*
page 36
MARKS DO NOT
WRITE IN
THIS
MARGIN
19. (c) (continued)
*X816750137*
page 37
MARKS DO NOT
WRITE IN
THIS
MARGIN
ADDITIONAL SPACE FOR ANSWERS
*X816750138*
page 38
MARKS DO NOT
WRITE IN
THIS
MARGIN
ADDITIONAL SPACE FOR ANSWERS
*X816750139*
page 39
[BLANK PAGE]
Acknowledgement of copyright
Question 6 XEG/shutterstock.com
Question 13 MRony/shutterstock.com
Question 15(b)(ii) Image is taken from https://pixabay.com/en/fridge-kitchen-refrigerator-158792/.
Licensed under CCO Creative Commons.
*X816750140*
page 40