j276 - 02 May 2019 QP Ocr Gcse Computer Science
j276 - 02 May 2019 QP Ocr Gcse Computer Science
Do not use:
* 7 7 1 7 1 3 2 4 5 8 *
• a calculator
* J 2 7 6 0 2 *
First name(s) �
Last name �
INSTRUCTIONS
• Use black ink.
• Answer all the questions.
• Write your answer to each question in the space provided. If additional space is
required, use the lined page(s) at the end of this booklet. The question number(s) must
be clearly shown.
INFORMATION
• The total mark for this paper is 80.
• The marks for each question are shown in brackets [ ].
• This document consists of 24 pages.
No calculator can
be used for this
paper
1 (a) A radio station records an interview with a computer scientist using a computer and audio
recording software.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
A second interview with the computer scientist is recorded. Before this interview, the sampling
frequency in the audio software is increased.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [1]
© OCR 2019
3
(iii) Tick (✓) two boxes to show the effects of increasing the sampling frequency.
[2]
(b) The radio station uses a digital camera to take a photograph of the computer scientist for their
website. The photograph is stored as a bitmap image.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [3]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
The image is compressed using lossy compression before being uploaded to the radio
station’s web server. The image will be used on the radio station’s website.
(iii) Describe one advantage and one disadvantage of using lossy compression on the
image that will be used on the website.
Advantage .........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Disadvantage ....................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[4]
© OCR 2019
5
BLANK PAGE
Start
Input X
Input Y
FALSE
Output
X>Y?
Y*X
TRUE
FALSE
X < 12 ?
TRUE
Output Output
X Y
End
© OCR 2019
7
(a) Complete the table to give the output when each of the following set of values are input into
the algorithm as X and Y.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [6]
(c) Describe two methods of translating high level code into machine code.
1 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [4]
© OCR 2019
9
3 Louise writes a program to work out if a number entered by the user is odd or even. Her first
attempt at this program is shown.
03 print(“even”)
04 else
05 pritn(“odd”)
06 endif
...........................................................................................................................................
...................................................................................................................................... [1]
(ii) Give a corrected version of line 02 that fixes the logic error.
...........................................................................................................................................
...................................................................................................................................... [1]
...........................................................................................................................................
...................................................................................................................................... [1]
(ii) Give a corrected version of line 05 that fixes the syntax error.
...........................................................................................................................................
...................................................................................................................................... [1]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
(ii) Give one example of how abstraction could be used when developing this program.
...........................................................................................................................................
...................................................................................................................................... [1]
(b) Describe two examples of defensive design that should be considered when developing this
program.
1 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [4]
© OCR 2019
11
The number of goals scored in each football match is held in an array called goals. An example
of this array is shown.
goals = [0, 1, 3, 0, 4, 5, 2, 0, 2, 1]
(c) Complete the following pseudocode for an algorithm to count up how many matches with 0
goals are stored in the array and then print out this value.
01 nogoalscount = 0
03 if goals[…………………………] == 0 then
04 nogoalscount ……………………………………………………
05 endif
06 next count
07 print(……………………………………………)
[3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [2]
(b) Convert the binary number 1011011 to denary. Show your working.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [1]
© OCR 2019
13
(d) Add the following binary numbers.
1 0 1 1 0 1 1 0
+ 1 0 0 1 1 1
[2]
(e) Complete the truth table for the following logic gate.
A
Q
B
A B Q
0 0 0
0 1 1
1
[4]
(a) A function, ticketprice(), takes the number of adult tickets and the number of child tickets
as parameters. It calculates and returns the total price to be paid.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [6]
© OCR 2019
15
(ii) Tick (✓) one box to identify the data type of the value returned from the function
ticketprice(), justifying your choice.
Integer
Real
Boolean
String
Justification .......................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(i) Give one benefit of using a check digit for the discount code.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [1]
(i) State one reason why a binary search would not be able to be used with this data.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [1]
(ii) Give the name of one searching algorithm that would be able to be used with this data.
...........................................................................................................................................
...................................................................................................................................... [1]
© OCR 2019
17
BLANK PAGE
01 swaps = True
02 while swaps
03 swaps = False
04 for p = 0 to queuesize.length-2
06 temp = queuesize[p]
07 queuesize[p] = queuesize[p+1]
08 queuesize[p+1] = temp
09 swaps = True
10 endif
11 next p
12 endwhile
(i) Explain the purpose of the Boolean variable swaps in this bubble sort algorithm.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
© OCR 2019
19
(iii) Describe one way that the maintainability of this algorithm could be improved.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...................................................................................................................................... [2]
(iv) Give the names of two other sorting algorithms that could be used instead of bubble
sort.
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
[2]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
© OCR 2019
21
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [8]
© OCR 2019 END OF QUESTION PAPER
22
ADDITIONAL ANSWER SPACE
If additional space is required, you should use the following lined page(s). The question number(s)
must be clearly shown in the margin(s).
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
© OCR 2019
23
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
© OCR 2019
24
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
..................................................................................................................................................................
© OCR 2019