June 2021 (v1) QP
June 2021 (v1) QP
June 2021 (v1) QP
1 hour 30 minutes
INSTRUCTIONS
● Answer all questions.
● Use a black or dark blue pen.
● Write your name, centre number and candidate number in the boxes at the top of the page.
● Write your answer to each question in the space provided.
● Do not use an erasable pen or correction fluid.
● Do not write on any bar codes.
● You may use an HB pencil for any diagrams, graphs or rough working.
● Calculators must not be used in this paper.
INFORMATION
● The total mark for this paper is 75.
● The number of marks for each question or part question is shown in brackets [ ].
● No marks will be awarded for using brand names of software packages or hardware.
DC (LO) 213986
© UCLES 2021 [Turn over
PMT
1 Real numbers are stored in a computer system using floating-point representation with:
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(b) Calculate the denary value of the given binary floating-point number.
Show your working.
Mantissa Exponent
1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 1
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answer ......................................................................................................................................
[3]
Mantissa Exponent
0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1
Mantissa Exponent
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
(d) The denary number 513 cannot be stored accurately as a normalised floating-point number in
this computer system.
...........................................................................................................................................
More than 10 bits are required to store accuratly
...........................................................................................................................................
513 in binary will be 1000000001
which will result in overflow
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(ii) Describe an alteration to the way floating-point numbers are stored to enable this number
to be stored accurately using the same total number of bits.
...........................................................................................................................................
the number of mantissa should be increased to 11 or 12
exponate 5 or 4
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(i) SchoolDay to hold data about the days students are usually in school.
...........................................................................................................................................
Type SchoolDay = (sunday monday tuesday wednesday thursday
..................................................................................................................................... [1]
(ii) WeekEnd to hold data about the days that are not school days.
Type WeekEnd= (Friday,Saturday)
...........................................................................................................................................
..................................................................................................................................... [1]
(c) Define, using pseudocode, the composite data type ClubMeet. This will hold data about club
members that includes:
...................................................................................................................................................
...................................................................................................................................................
Type ClubMeet
DECLARE FIRST NAME: STRING
...................................................................................................................................................
DECLARE LAST NAME:STRING
DECLARE SchoolDay:SchoolDay
...................................................................................................................................................
DECLARE WeekEnd:WeekEnd
Endtype
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
3 (a) Draw one line to connect each Operating System (OS) term to the most appropriate
description about it.
OS term Description
Interrupt handling
Scheduling
Transferring control to another routine when
a service is required
Virtual memory
Reading/writing same-size blocks of data
from/to secondary storage when required
[5]
(b) Explain how an interpreter executes a program without producing a complete translated
version of it.
...................................................................................................................................................
The interupter reads the ode one at a time
...................................................................................................................................................
if there inno error it will continue
If there is a error it will report it and stop
And the interrupter will always run when the program runs
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
4 (a) (i) Explain why Reverse Polish Notation (RPN) is used to carry out the evaluation of
expressions.
...........................................................................................................................................
reverse polish notation is amazing way of represintng an expresiion
it reads from left to right no brackets neede no bodmas needed
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(ii) Identify, with reasons, a data structure that could be used to evaluate an expression
in RPN.
...........................................................................................................................................
Stack:
The operand are pushed to the stack in revers order from which they where
...........................................................................................................................................
pushed into
...........................................................................................................................................
..................................................................................................................................... [2]
(a – b) * (a + c) / 7
...................................................................................................................................................
............................................................................................................................................. [1]
ab- ac+* 7/
(c) Write the RPN expression as an infix expression.
a b / 4 * a b + -
a/b 4-(a+b)
...................................................................................................................................................
............................................................................................................................................. [1]
a b + c d / /
...................................................................................................................................................
(17+3)/(48/12)
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
5 (a) Calculate the shortest distance between the base and each of the other towns in the diagram
using Dijkstra’s algorithm.
Show your working and write your answers in the table provided.
Base
4
5
Town 1 2
1 Town 2
8
Town 3
7 3 Town 6
1
5
6
Town 4 Town 5
Working .....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
Answers
[5]
...................................................................................................................................................
artfical neural networks can be reprsented using graphs
Ai probelem can be solved
...................................................................................................................................................
garphs may be analised
machine learning
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
..........................................................................................................................................................
Better security because packets are hash and send by diffrent routes
Benefit 2 ...........................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Drawback 2 ......................................................................................................................................
..........................................................................................................................................................
[4]
A P
Y
B
C R
Z
Q
(a) Complete the truth table for the given logic circuit. Show your working.
............................................................................................................................................. [1]
Full adder
(c) Write the Boolean expressions for the two outputs Y and Z in the truth table as
sum-of-products and state the purpose of each output.
Y=ABC+ABC+ABC+ABC
Y = ............................................................................................................................................
Purpose: Sum bit
Purpose ....................................................................................................................................
Z=ABC+ABC+ABC+ABC
Z = ............................................................................................................................................
10
8 (a) State two factors that may affect the performance of a sorting algorithm.
...................................................................................................................................................
The intial order of the data
the effinceny of sorting algorthim
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
(b) The given algorithm is a simple bubble sort that arranges a set of scores stored in a one-
dimensional array into descending order, and orders the corresponding students’ names
stored into a two-dimensional array in the same order as the scores. All the arrays are indexed
from 1.
Name
Score
1 2
1 98 1 Smithfield Tom
2 97 2 Johnson Jane
… …
←
←
YearSize 249
Flag TRUE
←
WHILE Flag = TRUE
←
Flag FALSE
FOR Student 1 TO YearSize - 1
←
IF Score[Student] < Score[Student + 1] THEN
←
Temp1 Score[Student]
←
Temp2 Name[Student,1]
←
Temp3 Name[Student,2]
←
Score[Student] Score[Student + 1]
←
Name[Student,1] Name[Student + 1,1]
←
Name[Student,2] Name[Student + 1,2]
←
Score[Student + 1] Temp1
←
Name[Student + 1,1] Temp2
←
Name[Student + 1,2] Temp3
Flag TRUE
ENDIF
NEXT Student
ENDWHILE
11
Write an algorithm, using pseudocode, that will perform the same task using an insertion sort.
...................................................................................................................................................
...................................................................................................................................................
YearSize 249
FOR Student 2 to YearSize
...................................................................................................................................................
Temp1 Score[Student]
Temp2 Name[Student,1]
...................................................................................................................................................
Temp3 Name[Student,2]
Counter Student
...................................................................................................................................................
WHILE Counter > 1 AND Score[Counter - 1] < Temp1
Score[Counter] Score[Counter - 1]
...................................................................................................................................................
Name[Counter,1] Name[Counter - 1,1]
Name[Counter,2] Name[Counter - 1,2]
...................................................................................................................................................
Counter Counter – 1
ENDWHILE
...................................................................................................................................................
Score[Counter] Temp1
Name[Counter,1] Temp2
...................................................................................................................................................
Name[Counter,2] Temp3
NEXT Student
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [6]
12
...................................................................................................................................................
Imperative language uses variables
which are changed using assignments stament
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
...................................................................................................................................................
Instruct a program to what needs to be done
using facts and rules
...................................................................................................................................................
using queries to satisfy goals
...................................................................................................................................................
............................................................................................................................................. [2]
(c) Identify the programming paradigm for each of these program code examples.
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
reasonable effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.