0% found this document useful (0 votes)
21 views

Computer Science Topic 1.4 Questions

Uploaded by

BXR Studios
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Computer Science Topic 1.4 Questions

Uploaded by

BXR Studios
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Computer Science OCR A Level

1.4 Data Types, Data Structures &


Algorithms

Topic Questions

1.4.1 Data Types


1.4.2 Data Structures
1.4.3 Boolean Algebra

TOTAL MARKS - /170


Time Allowed - 3 Hours

Questions from 2017-2020


I won’t include every paper as you should save some questions for past papers
Although you can still do 2017-2020 papers even if you do this topic paper.

This document is to help consolidate knowledge and review topics after learning the
content. A time has been given if you want to time yourself you don’t need to and you
should do at your own pace if you wish. The time adds roughly 10 minutes extra just like
the exam. Aim for a mark a minute if doing this timed.

Some Questions may overlap with other topics. If you don’t know the
knowledge for that overlap question or cannot be asked just skip it.
I don’t have OCR ExamBuilder so I cannot do much about overlap questions
(same applies with the mark scheme at the end of the document)

Not all topics can be covered given the timeframe of papers I have used so it is still up to
you to go through the specification and practice content from the other papers.
2017 Questions 4
2 A coach company offers tours of the UK.

(a) A linked list stores the names of cities on a coach tour in the order they are visited.

London Oxford Birmingham Manchester null

(i) Describe what is meant by the term ‘linked list’.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [3]

(ii) The tour is amended. The new itinerary is: London, Oxford, Manchester then York.
Explain how Birmingham is removed from the linked list and how York is added. You may
use the diagram below to illustrate your answer.

London Oxford Birmingham Manchester null

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [4]

© OCR 2017
5
The program stores records about its customers.

(b) Often an individual customer’s record needs to be accessed. This is done by searching using
the Customer ID. Explain why a hash table is better suited than a linked list to store the
customer records, particularly as the company acquires more customers.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [4]

© OCR 2017 Turn over


8
4 A cinema offers discounted tickets, but only under one of the following conditions:
• Customer is under 18 and has a student card.
• Customer is over 60 and has ID which proves this.

Let:

A be Customer is under 18

B be Customer has a student card

C be Customer is over 60

D be Customer has ID

Q be Discount ticket issued

(a) Complete the Boolean expression below:

Q≡ .......................................................................................................................

[3]

(b) The cinema has a voucher which promises free popcorn when the voucher is produced whilst
buying a soft drink or bottle of water.

Let:

E be Voucher is shown

F be Soft drink is bought

G be Bottle of water is bought

R be Free popcorn given.

This could be written as:

R ≡ (E/F) 0 (E/G)

© OCR 2017
9
(i) Complete the truth table below.

E F G (E/F) (E/G) (E/F)0(E/G)


1 1 1
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0
[4]

(ii) Simplify the expression

(E/F) 0 (E/G)

...........................................................................................................................................

...................................................................................................................................... [2]

Most films are now distributed to cinemas digitally. A studio allows cinemas to download its latest
film 5 days before the release date via a private download. It wants to ensure that no cinema
shows it before the release date.

(c) Describe one technical measure the studio could use to ensure that films are not shown
early.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [2]

© OCR 2017 Turn over


12
6 (a) (i) Convert the denary number 188 to an unsigned 8-bit binary number.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [1]

(ii) Convert the denary number 188 to hexadecimal.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [1]

(b) (i) Convert the denary number −44 to an 8-bit binary number with sign and magnitude
representation.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [1]

(ii) Convert the denary number −44 to an 8-bit binary number with two’s complement
representation.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [1]

(c) Explain how, using bit shift, the unsigned binary number 00101100 can be divided by 4.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [2]

© OCR 2017
13
(d) Demonstrate subtraction on the two numbers below, both stored in normalised floating point
format, using 6 bits for their mantissa and 4 for their exponent. Show the result in the same
format. Show your working.

010010 0100 - 010010 0010

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [6]

© OCR 2017 Turn over


24
11 A half adder has the truth table shown below:

A B Sum Carry
1 1 0 1
1 0 1 0
0 1 1 0
0 0 0 0

(a) Draw a half adder using logic gates.

[3]

© OCR 2017
25
(b) Draw the logic gates represented by the Karnaugh Map below. Show your working.

AB

00 01 11 10

00 1 1 0 0

CD 01 1 1 0 0

11 0 0 1 1

10 0 0 1 1

[4]

END OF QUESTION PAPER

© OCR 2017
2018 Questions 15
7 A taxi firm is investigating replacing its drivers with self-driving cars.

(a) Explain why the self-driving system will use a real-time operating system.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [3]

© OCR 2018 Turn over


16
(b) The code for the self-driving system has been written using an object-oriented programming
language.

It recognises obstacles in the road and then classifies them.


The class for Obstacle is shown below.

public class Obstacle


private moving //Boolean value
private distance //Real number given in metres
private direction //Integer given as between 1 and 360 degrees

public procedure new(givenMoving, givenDistance, givenDirection)


moving=givenMoving
distance=givenDistance
direction=givenDirection
endprocedure

public procedure updateDistance(givenDistance)


distance=givenDistance
endprocedure

endclass

(i) Write a line of code to create an object called bollard of type Obstacle which is not
moving and is 7.8 metres away in a direction of 8 degrees.

...........................................................................................................................................

...................................................................................................................................... [2]

(ii) Describe an example of encapsulation in the class definition code above.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]

(iii) Describe the advantages of using encapsulation.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]

© OCR 2018
17
(c) The self-driving program recognises people as a special type of obstacle and the class
Person should inherit the methods and attributes of Obstacle. People are treated like other
obstacles except:
• when the updateDistance method is called, if the person is more than 2 metres away
but is 5 metres (or less) away, the method Controls.beepHorn() is called.
• when the person is 2 metres away (or closer), the method Controls.applyBrakes()
is called as well as Controls.beepHorn().

Complete the class Person.

class Person .................................................................

public procedure updateDistance(givenDistance)

....................................................................................................

....................................................................................................

....................................................................................................

....................................................................................................

....................................................................................................

....................................................................................................

....................................................................................................

....................................................................................................

....................................................................................................

....................................................................................................

....................................................................................................

distance=givenDistance
endprocedure
endclass [5]

(d) Give one advantage and one disadvantage to the customers of the taxi using self-driving
cars rather than drivers.

Advantage

...................................................................................................................................................

...................................................................................................................................................

Disadvantage

...................................................................................................................................................

...................................................................................................................................................
[2]
© OCR 2018 Turn over
22
9 (a) Demonstrate how the bytes below are added together. Show your working.

01101010
00111111+

[2]

(b) Demonstrate how the bottom byte below is subtracted from the top byte. Show your working.

11001111
00111001 -

[2]

(c) Convert the binary number shown below to hexadecimal.

0011011100001111
...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [2]

(d) The number below is represented in floating point format with a 5-bit mantissa in two’s
complement followed by a 3-bit exponent in two’s complement. Calculate the denary value of
the number, showing your working.

01001 010

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [3]

© OCR 2018
23
(e) The numbers below are represented in floating point format with a 5-bit mantissa in two’s
complement followed by a 4-bit exponent in two’s complement. Normalise the numbers
shown below, showing your working.

00011 0010

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [2]

11100 0110

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [2]

(f) Show the byte below after having an AND applied with the masking byte.

Byte 1 0 1 1 1 0 0 1
AND 1 1 1 1 1 1 1 1
Result
[1]

(g) Show the byte below after having an OR applied with the masking byte.

Byte 1 0 1 1 1 0 0 1
OR 1 1 1 1 1 1 1 1
Result
[1]

© OCR 2018 Turn over


24
10 (a) Draw a logic gate diagram to represent the Boolean expression

Q ≡ ¬A0B

[2]

(b) Find the Boolean expression represented in the Karnaugh Map below. Show your working.

AB

00 01 11 10

00 1 1 1 1

CD 01 0 0 1 1

11 0 0 0 1

10 0 0 0 1

[5]

END OF QUESTION PAPER

Oxford Cambridge and RSA


Copyright Information
OCR is committed to seeking permission to reproduce all third-party content that it uses in its assessment materials. OCR has attempted to identify and contact all copyright holders
whose work is used in this paper. To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced in the OCR Copyright
Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download from our public website (www.ocr.org.uk) after the live examination series.
If OCR has unwittingly failed to correctly acknowledge or clear any third-party content in this assessment material, OCR will be happy to correct its mistake at the earliest possible
opportunity.
For queries or further information please contact the Copyright Team, First Floor, 9 Hills Road, Cambridge CB2 1GE.
OCR is part of the Cambridge Assessment Group; Cambridge Assessment is the brand name of University of Cambridge Local Examinations Syndicate (UCLES), which is itself a
department of the University of Cambridge.

© OCR 2018
2019 Questions 10
5 A programmer is writing software for a firewall. She is writing code so that it keeps a track of
websites that users are permitted to visit. The software stores the websites’ addresses along with
details about who can view them and when.

The following data is also stored about each website:

• Access level needed (1-4)


• If it is available all the time (true) or just lunch times and out of work hours (false).

So a website which is available to users of access level 2 and above, all the time, would have the
details [2, true] stored.

A website accessible to users of access level 3 and above, only outside of work hours, would have
the details [3, false] stored.

(a) State the name of a data structure that could be used to store a single site’s details.

...................................................................................................................................................

.............................................................................................................................................. [1]

The address of each website, along with the relevant details, are stored in a hash table.

The hash table’s hash function is carried out on the website’s address (which acts as the key).
The hash function works in the following way:

1. Discard the characters up to and including the first dot.


2. Discard the characters including and to the right of the remaining leftmost dot.
3. Convert the characters to uppercase.
4. Add the ASCII values of the characters together.

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

For example www.ocr.org.uk gets hashed in the following manner:

Step 1:

ocr.org.uk

Step 2:

ocr

Step 3:

OCR

Step 4:

79+67+82 = 228

giving a hashed value of 228.


© OCR 2019
11
(b) State what hashed value would be given by the website www.foo.co.uk

...................................................................................................................................................

.............................................................................................................................................. [1]

(c) Complete the function hash which takes in a string and returns the hashed value.

You can assume you have access to the following three functions.

• asc() – this takes in a character and returns its ASCII value. For example asc("A")
returns 65.
• locate() – this takes in a string and character and returns the location of the first
instance of the character (with the string starting at character 0). For example
locate("electricity","c") returns 3.
• upper() – this takes in a string and returns the UPPERCASE version. For example
upper("hello") returns "HELLO".

You should also assume that all given website names use letters but no numbers or symbols.

You will be given credit for the readability of your code.

function hash(siteName)

endfunction

[5]

© OCR 2019 Turn over


12
A flaw with the current hash function is it tends to generate lots of collisions (addresses that compute
to the same hash). Below is a diagram of part of the hash table. The address www.rnd.com with
details [2, true] is being added to the hash table.

(d) Explain how a hash table can be used to handle collisions, referring to the example below.

227
228 www.ocr.org.uk : [1, true]
229
230 www.ppf.nz : [2, false]
231
232 www.ntf.biz : [4, true]
234
235

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [4]

© OCR 2019
13
The hash function is changed so there are no longer high numbers of collisions.

During busy periods the firewall is expected to check several addresses a second. It is anticipated
that roughly 10 new addresses will be added to a whitelist (list of acceptable addresses) each day.

There is a debate as to whether a hash table (with the new hash function) is the best approach, or
if the whitelist would be better stored in a linked list.

(e) *Discuss whether a hash table or linked list is better to store acceptable websites. You
should compare how each structure can be searched and has data added and come to a
recommendation as to which is better for the whitelist. [12]

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

© OCR 2019 Turn over


14

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

© OCR 2019
22
10 (a) Show how the binary number 01011110 is represented in hexadecimal.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [1]

(b) Show how the hexadecimal number 9B is represented in denary.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [2]

(c)

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [2]

(d) Complete the following binary subtraction. Show your working.

01001001-
00101111

[2]

© OCR 2019
23
(e) The floating point binary number 010011 011 consists of a 6-bit mantissa and 3-bit exponent,
both represented in two’s complement. Convert the number to denary, showing your working.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [3]

(f)
exponent in two’s complement, using as few bits as possible. Show your working.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [4]

© OCR 2019 Turn over


2020 Questions 6
2 A supermarket uses an object-oriented approach to organise items that it offers for sale. Part of
the class definition for the ItemForSale class is shown below.

class ItemForSale
public itemName
public price
public discount

endclass

(a) The discount attribute represents a percentage discount on the price. The discount can be
between 0 and 50 (inclusive). All new items for sale initially have a discount value of 0.

(i) Write the constructor method for the ItemForSale class.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [4]

(ii) Write a line of code to create an object of type ItemForSale called mushypeas that
has a name of “mushy peas” and a price of £0.89

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [3]

© OCR 2020
7
(iii) Write the calculatePrice() method, which applies the percentage discount to the
price and returns the new value.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [3]

(b) The supermarket has previously had issues with discounts being set as values above 50.

Explain how encapsulation could be applied to the ItemForSale class to stop this problem
from occurring.

You are not expected to write any code in your answer to this question.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [3]

© OCR 2020 Turn over


8
Some items in the supermarket are only available through home delivery. These items are the
same as ItemsForSale with the following exceptions:

• the supermarket also stores the location of the stock


• the percentage discount allowed is up to 75 rather than the standard 50.

(c) Explain how inheritance can be used to implement the above requirements.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [4]

© OCR 2020
9
3 (a) (i) Convert the denary number −119 to an 8-bit binary number with two’s complement
representation.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [1]

(ii) Convert the unsigned binary number 1101101 to hexadecimal.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [1]

(iii) Convert the denary number 171 to hexadecimal.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [1]

(iv) Convert the hexadecimal number A6 to binary.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]

© OCR 2020 Turn over


10
(b) Show how the denary value −9.125 can be represented in normalised floating point format,
using 8 bits for the mantissa and 4 bits for the exponent, both in two’s complement.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

.............................................................................................................................................. [5]

(c) (i) Show the result of applying an XOR mask of 1100 0111 to the byte 0101 1101.

Byte 0101 1101


XOR mask 1100 0111

[2]

(ii) Describe a mask that could be applied to an 8-bit number to ensure that:

• the most significant bit is always set to 1


• all other bits remain unchanged.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]

© OCR 2020
11
4 (a) (i) Complete the Karnaugh map below for the Boolean expression (¬ A ∧ ¬ B) ∨ ( A ∧ ¬ B)

AB

00 01 11 10

00

CD 01

11

10

[3]

(ii) Use the Karnaugh map to find a simplified Boolean expression that is equivalent to
(¬ A ∧ ¬ B) ∨ ( A ∧ ¬ B)

...........................................................................................................................................

...................................................................................................................................... [2]

© OCR 2020 Turn over


12
(b) (i) State the purpose of a D-type flip-flop circuit.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]

(ii) Describe the inputs and outputs used by a D-type flip-flop circuit, explaining how the
inputs are used to control the outputs.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [4]

© OCR 2020
18
8* Procedural programming and object-oriented programming are two paradigms commonly used by
programmers when developing computer games.

Discuss the advantages of using object-oriented programming over procedural programming when
developing computer games. You should refer to inheritance, encapsulation and polymorphism in
your answer.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

© OCR 2020
19

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

................................................................................................................................................... [12]

9 (a) Imogen buys a desktop computer. It comes with an operating system installed.

(i) Describe two ways that an operating system could manage physical memory.

1 ........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

2 ........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................
[4]

(ii) Explain one benefit of memory management to the user.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]

(iii) Describe how virtual memory allows a user to run programs when physical memory is
full.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

...................................................................................................................................... [2]
© OCR 2020 Turn over
2017 Mark Scheme
H446/01 Mark Scheme June 2017

c i Advantage: 2 Accept for MP1 better security


- Centrally administered in one location.
(1) (AO1.2) Do not credit quick access as an advantage

- One location to back up. (1)

Disadvantage:
- Central point of failure. (1)

- Can be expensive to maintain/set up


(e.g. cabling costs, specialist staff.) (1)

(Max 1 Advantage, 1 Disadvantage)

ii A hardware device/piece of software that 1 Accept ‘content’ for ‘traffic/packages’


monitors (and filters/blocks) traffic/packets going
to and from a network. (1) (AO1.1)
(Max 1)

iii Prevent unauthorised access to a network. (1) 1 Accept for MP1 malicious attacks/traffic
To restrict applications that are used internally that
have internet access. (1) (AO 1.2)
To restrict websites that can be accessed from within
the company. (1)
To protect the company’s data/intellectual property.
(1)
(Max 1)

2 a i A dynamic/data structure (1) 3 Accept ‘element’ instead of ‘node/item’


Each node/item consists of data and pointer (1)
Pointer gives location of next node. (1) (AO1.2)
2017 MS Starts Here

5
H446/01 Mark Scheme June 2017

ii Description can be written: 4

- Oxford pointer changed to bypass Birmingham and (AO2.1)


point to Manchester. (1)

- A node is created holding the data York/York is


placed is next free space/node/item (1) On diagram don’t penalise if the pointer from Birmingham is left intact. It
should be clear in both diagram and text that Oxford no longer points to
- Manchester remains in original position and pointer Birmingham.
changed to point to the York node. (1)
In diagram solution, London, Oxford and Manchester must remain in the
- The York node points to null (or terminator). (1) same positions.

OR via diagram eg.:

b A linked list requires every node to be checked (until 4 Some candidates may talk about time complexity: linked lists being
the desired record is found). (1) linear/O(n) and hash table being constant/O(1) Accept these as points 1& 2
A linked list will take longer to search (as more nodes (AO1.2 - 2 and 3 & 4 conjoined i.e. full marks.
are added). (1) marks
A hash table enables direct access to the location of
the record. (1) AO2.2 -
A hash table will take the same time to search (as
more nodes are added)/It takes no longer as more 2 marks)
records are added. (1)

3 a i Downloads quicker. (1) 1 Do not accept ‘saves the user space on their device’.
Saves user money by using less bandwidth/ on data
usage. (1)
(Max 1)
(AO1.2)
Ignore

6
H446/01 Mark Scheme June 2017

4 a Q ≡ (A∧B) ∨ (C∧D) 3 Accept (C∧D) ∨ (A∧B)

2017 MS Continues Here (AO1.2) Accept (B∧A) instead of (A∧B)

1 mark for (A∧B) Accept (D∧C) instead of (C∧D)

1 mark for (C∧D) Accept alternative notations (e.g. +/. OR/AND)

1 mark for the ∨ joining the two parts. Accept AB as (A.B) and CD as (C.D)

Accept answers without brackets

b i E F G (E∧F) (E∧G) (E∧F)∨(E∧G) 4

1 1 1 1 1 1 (AO1.2)
1 1 0 1 0 1
1 0 1 0 1 1
1 0 0 0 0 0
0 1 1 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 0 0 0

1 mark for each of the pairs of rows.

10
H446/01 Mark Scheme June 2017

ii (F∨G) ∧ E 2 Accept:

(AO2.2) (G∨F) ∧ E

One mark for the (F∨G) E∧(F∨G)

One mark for the ∧ E E∧(G∨F)

4 c Encrypt the film (1) 2 Accept

Send the key/password out on the release date (1) (AO2.2) Use Digital Rights Management/DRM…

..To keep content encrypted until given date.

5 a i - Stores the value 10 (1) 3 MP3 Accept identifier

- In a memory location (1) (AO1.2)

- Given the label/symbolic address ten (1) Ignore Q5

ii Starting value in Pass or Fail 3


Accumulator (AO2.1)
29 Fail
30 Pass
31 Fail
1 Mark per row

b i LDA (1) 1
SUB (1)
ADD (1) (AO1.2)
INP (1)
(Max 1)

11
H446/01 Mark Scheme June 2017

ii BRA (1) 1
BRP (1)
BRZ (1) (AO1.2)

(Max 1)

iii 20 1

(AO2.1)

iv 40 1

(AO2.1)

v Rounds up (the number input)… (1) 2 Rounds to multiple of ten gets one mark.

…To the nearest multiple of ten (and outputs it) (AO2.2)


(1)

6 a i 10111100 1

(AO1.2)
2017 MS Continues Here
ii BC 1

(AO1.2)

b i 10101100 1

(AO1.2)

12
H446/01 Mark Scheme June 2017

ii 11010100 1

(AO1.2)

c Shift Right (1) 2 Allow one mark for correct number of places but wrong direction.

Two Places (1) (AO1.2)

d Binary point: shifted four places gives: 6 Correct answer with clear binary subtraction/2’s complement addition
01001.0 (1) calculation gives full marks.
Binary point shifted two places gives: (AO1.2)
010.010 (1)

Subtraction carried out …


01001.000 -
010.010
(1)

…‘Borrowing’ shown… (1)

…Answer: 0110.110 (1)

Normalised to: Mantissa 011011 (1)

Exponent 0011 (1)

7 a A field which has a unique value for every record/A 2


unique identifier. (1) Ignore
(AO1.1 –

13
H446/01 Mark Scheme June 2017

read and processed (i.e. parsed) by the syntax analyser.

Syntax Analysis is necessary to ensure the code is valid in as much as it


meets all the structural rules of the language. This guarantees it will run
(though it might not do as expected and may still have occurrences of run-
time errors).

Code generation is necessary to turn the code into a format that the
processor can understand (i.e. binary machine code).

The code optimisation whilst not necessary, does ensure the code runs
quicker or using less memory.

Linking is necessary to ensure the library code is incorporated into the final
program.

11 a - 3

(AO1,1)

2017 MS Continues Here

XOR Gate (1)

AND Gate (1)

Correct connections and no additional gates (1)

22
H446/01 Mark Scheme June 2017

11 b - - Correctly identified groups on Karnaugh 4


map/Correct boolean statement.(1)
(AO2.2)
AB
- NOT A AND NOT C Gates (1)

- A AND C gates (1)


00 01 11 10

- Both sets of gates joined by OR gate (with no other


00 1 1 0 0
gates used). (1)
CD 01 1 1 0 0

11 0 0 1 1
10 0 0 1 1

(¬A ∧ ¬C) ∨ (A∧C)

Or equivalent.

Or equivalent.

23
2018 Mark Scheme
H446/01 Mark Scheme June 2018

Question Answer Mark Guidance


7 a - Needs to be able to respond instantly to 3
changes… (AO1.2)
- …such as someone stepping in front of car (or
other sensible example)
- RTOS offers a guaranteed response time.
- A non RTOS might be busy dealing with other
tasks and not respond until it is too late.

(1 Mark per -, Max 3)


b i - Created Obstacle object called bollard 2 Examples
- Has put the correct arguments in, in the correct (AO3.2) bollard=new Obstacle(false, 7.8, 8)
order. Obstacle bollard = Obstacle(false, 7.8, 8);
(1 Mark per -, Max 2) bollard=Obstacle(False, 7.8, 8)

Do not penalise for use of self parameter as used by


languages such as Python.

ii -The attribute distance is private… 2


-…and therefore updated with the method update (AO3.2)
distance

24
H446/01 Mark Scheme June 2018

Question Answer Mark Guidance


iii - Reduces the chance of errors/inconsistences 2 Read ‘securing’ as ‘protecting’
- Ensures objects can only be changed in the way (AO1.2)
intended/ Ensuring changes are consistent with
how the object should behave
- Protecting data/ Can’t be changed accidentally
(1 Mark per -, Max 2)

25
H446/01 Mark Scheme June 2018

Question Answer Mark Guidance


c - First line Clear use of inheritance of Obstacle. 5 class Person inherits Obstacle
E.g.: (AO3.2)
Person inherits Obstacle / public procedure
Person extends Obstacle / updateDistance(givenDistance)
Person : Obstacle / if givenDistance<=5 then
Person(Obstacle) Controls.beepHorn()
if givenDistance<=2 then
In the method Controls.applyBrakes()
- Less than 2 metres triggers brake endif
- Equal to but not greater than 2 metres triggers endif
brake. distance = givenDistance
- Less than or equal to 2 metres triggers horn endprocedure
- Less than or equal to 5 metres triggers horn
(1 Mark per -, Max 5) endclass

NB a number of ways exist of writing the method – be


careful of the logic. Two such correct examples are
below.
if givenDistance<=5 then
Controls.beepHorn()
endif
if givenDistance<=2 then
Controls.applyBrakes()
endif

if givenDistance<=2 then
Controls.beepHorn()
Controls.applyBrakes()
elseif givenDistance<=5 then
Controls.beepHorn()
endif

26
H446/01 Mark Scheme June 2018

Question Answer Mark Guidance


d Advantages of an automated driver are it is potentially: 2
- safer than a human driver (due to quicker reaction (AO2.2)
speeds etc.).
- cheaper as no wage to cover.
- less likely to make mistakes with route.

Disadvantages of an automated driver are it is


potentially:
- May not be able to understand natural speech.
- May be limited in terms of the roads on which it
can operate.
- Vulnerable to hacking.
- Only as good as the program running it – a bug in
the code could cause catastrophic accidents.
- May prioritise safety of pedestrians over that of
the passenger. (e.g. may take actions that may
put the passenger at risk to save the lives of
numerous people outside the car.)
- No discussion possible with the driver / no
"human presence" to reassure nervous
customers.

Max 1 advantage and max 1 disadvantage

27
H446/01 Mark Scheme June 2018

Question Answer Mark Guidance


9 a 10101001  Answer, 1 Mark 2
111111  Carry bits, 1 Mark (AO1.2)
b 1 2 Allow 2 marks for any other valid method with working
022  Borrowed bits, 1 Mark shown.
11001111 (AO1.2)
00111001 If converted to denary and calculated, no marks.
10010110  Answer, 1 Mark

c 370F 2
1 Mark for the first two digits (i.e. 37) (AO1.2)
1 Mark for the last two digit (i.e. 0F)
d -Exponent is 2 3
-Mantissa becomes 010.01 (AO1.2)
-Value is 2.25
(1 Mark per -, Max 3)
e 01100 0000 4
(AO1.2)
1 Mark for mantissa, 1 mark for exponent.

10000 0100

1 Mark for mantissa, 1 mark for exponent.

f 10111001 1 cao
(AO1.2)
g 11111111 1 cao
(AO1.2)

32
H446/01 Mark Scheme June 2018

Question Answer Mark Guidance


10 a 2
(AO1.2)

- A going into NOT gate.


- B and NOT A going into OR gate (and Q coming
out of it)
(1 Mark per -, Max 2)

b -Groups correctly identified (with no further groups). 5


- Answer includes ¬ C∧¬D (AO1.2)
- Answer includes A∧¬B
- Answer includes A∧¬C
- All three sections joined with ∨s in any order but with
no further sections.
E.g.
(A∧¬B )∨(A∧¬C )∨(¬ C∧¬D)
The brackets aren’t necessary
(1 Mark per -, Max 5)

33
2019 Mark Scheme
H446/01 Mark Scheme June 2019

e − High resolution videos take up large 3


amounts of memory/RAM AO2.2
− Due to the large number of pixels that
need to be represented
− When streaming, the data being sent is
time sensitive/ sufficient data (i.e. the
next chunk of video) needs to be
received and processed within a given
amount of time
− Otherwise there will be
pauses/buffering.
− Compression reduces the amount of
data that needs to be sent/bandwidth
needed
− Compression reduces the cost/data
usage for those with download limits

(1 per -, max 3)
5 a tuple / record / list 1
AO2.1
Don't accept array
2019 MS Starts Here
b 228 1 cao
AO2.1
H446/01 Mark Scheme June 2019

c − Removes/ignores characters up to and 5


including first dot AO3.2 function hash(siteName)
− Removes/ignores characters including //remove up to and including first dot.
and after second dot firstDot=locate(siteName,".")
− Converts characters in variable to siteName=siteName.substring(firstDot+1,siteName.length-firstDot -1)
uppercase
− Totals the ASCII values of the relevant //remove second dot and after
characters. secondDot=locate(siteName,".")
siteName=siteName.substring(0,secondDot)
siteName=upper(siteName)
Up to 1 mark for… value=0
− Sensible variable names. for i=0 to siteName.length-1
− Sensible indentation value=value+asc(siteName.substring(i,1))
− Useful comments. next i
return value
endfunction
NB Don’t penalise twice. If candidate hasn’t
removed/discounted the right characters they
may lose mark points 1 and/or 2. They can
still access mark points 3 and 4

(1 per -, max 5 )
H446/01 Mark Scheme June 2019

d 4
− rnd.com would cause a collision with AO1.2
ocr.org.uk/would has to the same
position as ocr.org.uk (228)

− Linear probing could be used Example diagrams


− Move through the structure one space
at a time Chaining
− …to find the next free space/229

− Chaining could be used


− Each location points (to the start of) a
linked list.
− The new item is added to the end of
the linked list/free.

− points to an overflow area


− The new item is stored with the other
values in the same area
Linear Probing
Accept a separate or annotated diagram
showing a method on given example

(1 per -, max 4)
H446/01 Mark Scheme June 2019

e Mark Band 3–High Level (9-12 marks) 12 Searching of a Linked list involves starting at the first node and following the pointers
The candidate demonstrates a thorough until either the desired value is found, or the end of the list is reached, meaning the
knowledge and understanding of storing and AO1.1 item isn’t in the list.
retrieving data from hash tables and linked (2)
lists. The material is generally accurate and AO1.2 The bigger the linked list grows, the longer it takes to search.
detailed. (2) If a linked list doubles in size it will, on average, take twice as long to search.
AO2.1 A list of size n takes on average n/2 checks.
The candidate is able to apply their knowledge (3) In Big O this is O(n), or linear complexity.
and understanding directly and consistently to AO3.3
the context provided. Evidence/examples will (5)
be explicitly relevant to the explanation. Searching of a hash table requires the key to be hashed and the correct location
accessed.
The candidate is able to weigh up both sides The time this takes is largely dependent on the time to create the hash.
of the argument which results in a supported If we ignore collisions, the time to find an item will stay the same regardless of the size
and realistic judgment as to which data of the white list.
structure is suitable. In other words it has O(1) or constant complexity.
Unfortunately as the white list grows collisions become more likely.
There is a well-developed line of reasoning Linear probing and chaining means that once a location has been found the time taken
which is clear and logically structured. The grows linearly with the number of collisions that have occurred for that location,
information presented is relevant and
substantiated. Nonetheless this is still going to perform significantly better than a linked list.
Mark Band 2-Mid Level (5-8 marks)
The candidate demonstrates reasonable If items are added to the end of the linked list then if the location of the last node is
knowledge and understanding of storing and stored, that location can be ready made to point at the new item.
retrieving data from hash tables or linked lists; The time to add items is constant.
the material is generally accurate but at times
underdeveloped. If they are added in some sort of order then the time to add items grows linearly due to
the time spent searching for the right position. (Storing in order has the advantage that
The candidate is able to apply their knowledge it is if an item isn’t in the list this can be deduced once its location is passed, rather
and understanding directly to the context than waiting until the end.)
provided although one or two opportunities are
missed. Evidence/examples are for the most Adding items to a hash table involves hashing the key and placing it in the correct
part implicitly relevant to the explanation. location.
This takes a constant amount of time..
The candidate makes a reasonable attempt to ..unless there are collisions then there is an overhead which grows with the number of
come to a conclusion showing some collisions for that location.
recognition of influencing factors that would
H446/01 Mark Scheme June 2019

determine which data structure is suitable.


Overall a hash table is likely to be the best option (assuming it has enough space and a
There is a line of reasoning presented with good hashing algorithm which produces a hash quickly and with few collisions).
some structure. The information presented is It will give very consistent performance even as the whitelist grows.
in the most part relevant and supported by
some evidence.
Mark Band 1-Low Level (1-4 marks) NB Big O Notation isn’t necessary for full marks as it is paper 2 content (though many
The candidate demonstrates a basic of the more able candidates are likely to include it). The question is assessing
knowledge of storing and retrieving data from candidate’s knowledge of traversing and adding to the two data structures and their
hash tables or linked lists; the material is basic ability to analyse this to determine their suitability for the scenario.
and contains some inaccuracies. The
candidate makes a limited attempt to apply
acquired knowledge and understanding to the
context provided.

The candidate provides nothing more than an


unsupported assertion.

The information is basic and communicated in


an unstructured way. The information is
supported by limited evidence and the
relationship to the evidence may not be clear.
0 marks
No attempt to answer the question or
response is not worthy of credit.
6 a − A program with one purpose/piece of 2
system software AO1.1
− …used for the upkeep/maintenance of Ignore Q6
the system
(1 per -, max 2)
b − Application performs tasks for the user 1
(rather than computer). AO1.2
− Performs generic (rather than specific)
tasks

c − Extreme programming is a software 4


H446/01 Mark Scheme June 2019

Judgments if made are weak and


unsubstantiated. The information is
basic and communicated in an
unstructured way. The information is
supported by limited evidence and the
relationship to the evidence may not be
clear.
0 marks
No attempt to answer the question or
response is not worthy of credit.
10 a 5E 1
AO1.2 2019 MS Continues Here
b 155 2
(1 mark for first two digits, 1 mark for final AO1.2
digit)

c 11010111 2
(1 Mark for the left most 1, 1 mark for the AO1.2
remaining 7 bits)
d 1121 2
022022 AO1.2
01001001-
00101111
00011010
1 mark for correct answer
1 mark for valid method
e − Exponent is 3 3
− Mantissa becomes 0100.11 AO1.2
− Which is 4.75. (accept 4¾ )
(1 per -, max 3)
f − In fixed point is 1010.11 4 For MP3 any number of leading 0s is valid (including none)
− Mantissa becomes 1.01011 AO1.2
− Exponent of 3 / 11
− Giving answer of 101011 011 2019 MS Ends Here
(1 per -, max 4)
2020 Mark Scheme
H446-01 Mark Scheme November 2020

Question Answer Mark Guidance


2 (a) (i) • Constructor method definition (.e.g new) 4 Example answer
• itemname, price passed in as parameters (must use public procedure new(nItemName, nPrice)
different identifier names to the ones in the AO3.2 itemname = nItemname
question) price = nPrice
discount = 0
• …and assigned to attributes
endprocedure
• discount attribute assigned to 0.
Look out for alternative notation
e.g.

this.itemname = itemName
(ii) • 1 mark for creating object with identifier 3 Example answers
mushypeas = mushypeas=new ItemForSale("mushy peas",
• 1 mark for creating object as type AO3.2 0.89)
ItemForSale
• mark for parameters passed in as needed ItemForSale mushypeas =
ItemForSale(“mushy peas”,0.89);

mushypeas=ItemForSale((“mushy
peas”,0.89);
Do not penalise for use of self parameter as used by
languages such as Python.
Must be correct case and spelling

(iii) • method definition for calculatePrice() 3 Percentage discount must be applied correctly.
• applies percentage discount
AO3.2 Example answer
• …returns calculated value
function calculatePrice()
newPrice = price – (price * discount/100)
return newPrice
end function
2 (b) • discount attribute made private 3
• Set method created
AO2.2
• …that restricts value to maximum 50%

2 (c) • Create new class 4


H446-01 Mark Scheme November 2020
• …inheriting from / subclass of ItemsForSale
• new attribute for stock location AO2.2
• calculatePrice() method overridden // new
version of calculatePrice() implemented in
subclass.
H446-01 Mark Scheme November 2020

Question Answer Mark Guidance


3 (a) i 1000 1001 1 Correct answer only

AO1.2
3 ii 6D 1 Correct answer only

AO1.2
3 iii AB 1 Correct answer only

AO1.2
3 iv 1010 0110 2 Correct answer only

1 mark per nibble AO1.2

3 (b) • 10110.111 in fixed point 5


• Move binary point four places to the left (1.0110111)
• Gives mantissa of 10110111 AO1.2
• therefore exponent is 4 = 0100
• Forming final answer of 10110111 0100

3 (c) (i) • 1001 1010 2 1 mark per nibble, mark left to right

AO1.2
(ii) • 1000 0000 2
• OR
AO2.2
H446-01 Mark Scheme November 2020

Question Answer Mark Guidance


4 (a) i 3
• left column filled with 1s (¬ A ∧ ¬ B) …
• right column filled with 1s ( A ∧ ¬ B)… AO1.2
(1)
• …Middle 2 columns filled with zero or blank AO2.2
(2)

4 ii 2
• ¬ B / NOT B
• Karnaugh map used to show 1s highlighted with AO2.2
overlap

4 (b) i • Delay / store a value… 2


• …of 1 bit
• When a signal is given AO1.1

4 (b) Ii • Data input 4


• Clock input
H446-01 Mark Scheme November 2020
• Q output AO1.1
(2)
• When clock input goes high… AO1.2
• …Q changes to D (2)
• NOT Q is reverse of Q
H446-01 Mark Scheme November 2020
Question Answer Mark Guidance
8 (a) Mark Band 3–High Level (9-12 marks) 12 AO1
The candidate demonstrates a thorough knowledge and Object oriented programming makes use of classes
understanding of procedural and object oriented AO1.1 (templates) from which objects are made.
programming. The material is generally accurate and (2) Classes have attributes and methods
AO1.2
detailed. (2) Classes can be encapsulated by making attributes
AO2.1 private and providing public access methods
The candidate is able to apply their knowledge and (23 Object oriented programming supports inheritance
understanding directly and consistently to the context AO3.3 which allows classes to use attributes and methods of
(5)
provided. Evidence/examples will be explicitly relevant parent classes.
to the explanation. Object oriented programming supports polymorphism
meaning that class attributes and methods can take on
The candidate provides a thorough discussion which is many different forms if required.
well balanced. Evaluative comments are consistently
relevant and well-considered. AO2
OO approach would call on classes per type of player
There is a well-developed line of reasoning which is or enemy object
clear and logically structured. The information Objects made from these classes, so one enemy class
presented is relevant and substantiated. may generate many enemy objects, each with different
values for their attributes (e.g. speed, energy)
Mark Band 2-Mid Level (5-8 marks) Special types of Player or Enemy objects could be
The candidate demonstrates reasonable knowledge instantiated from classes that inherit from the original
and understanding of procedural and object oriented Player/Enemy classes, but have attributes/methods of
programming; the material is generally accurate but at their own.
times underdeveloped. Polymorphism would allow for the attributes/methods of
Player/Enemy objects to behave differently from normal
The candidate is able to apply their knowledge and if required.
understanding directly to the context provided although
one or two opportunities are missed. AO3
Evidence/examples are for the most part implicitly OO promotes a modular approach (procedural through
relevant to the explanation. use of subroutines, OO through classes).

The candidate provides a sound discussion, the OO is an abstraction of a real world problem, with
majority of which is focused. Evaluative comments are classes for each type of things to be modelled and
for the most part appropriate, although one or two objects for each instance of these.
opportunities for development are missed.
OO has advantages in data security in that
encapsulation forces developers/users to use methods
H446-01 Mark Scheme November 2020
There is a line of reasoning presented with some (with their built in validation) to access/amend data
structure. The information presented is in the most part stored in attributes.
relevant and supported by some evidence.
OO has advantages in efficiency of design where
Mark Band 1-Low Level (1-4 marks) classes can be reused and can inherit from one
The candidate demonstrates a basic knowledge of another. Procedural programming struggles to support
procedural or object oriented programming; the material this.
is basic and contains some inaccuracies. The candidate
makes a limited attempt to apply acquired knowledge OO also offers flexibility through polymorphism.
and understanding to the context provided.

You might also like