You are on page 1of 57

Answer all the questions.

1. A supermarket uses a stock control system.

Details of products are stored on a stock database.

Explain how the system used in the supermarket can control the quantity of tins of beans in stock so that the
chance of running out is minimised.

[6]

© OCR 2018. You may photocopy this page. 2 of 58 Created in ExamBuilder


2. * A company enforces standard rules about writing functions on its programmers. Discuss the reasons why this
might be the case.

[9]

© OCR 2018. You may photocopy this page. 3 of 58 Created in ExamBuilder


3(a). A car has a feature in its engine management system that is intended to save fuel and emissions produced when
the car is waiting at traffic lights or in a traffic jam. The default option is that if the gears are disengaged and the
car is not moving, the engine is switched off. There is a display on the dashboard that indicates when the engine
has been switched off in this way.

However, sometimes it is necessary to keep the engine running even when the car is stationary, in order to
provide electric power to charge the battery, run the heater, run the air conditioning system or keep the lights on.
This, in turn, is affected by the external and internal temperatures, the settings chosen by the driver and the
intensity of light outside.

Identify four inputs needed by this feature of the engine management system.

For each one suggest a suitable data type for its storage.

Input Data type

[8]
(b). Identify two outputs from this engine management feature.

[2]

© OCR 2018. You may photocopy this page. 4 of 58 Created in ExamBuilder


4. Julie wants to earn her living by being a successful app developer.

Before she even writes any code, she thinks it would be sensible to find out some basic facts about app
development and the market for apps in order to maximise her chances of being successful.

State four items of data that she could obtain in order to make a sensible choice of an app development project.

[4]

© OCR 2018. You may photocopy this page. 5 of 58 Created in ExamBuilder


5(a). When a house is being built, the following activities take place:

plans are drawn


foundations are laid
bricks are ordered
bricks are delivered
walls are built
windows are installed
electric wiring is installed
plumbing is installed
roof rafters are installed
tiles are put on roof.

Explain how pipelining principles can be used to ensure that a house is built as quickly as possible.

[4]
(b). Describe two examples of where pipelining is used in any computer system.

[4]

© OCR 2018. You may photocopy this page. 6 of 58 Created in ExamBuilder


6(a). A flight simulator allows a user to take control of a simulated aeroplane. The user can fly the plane in an
environment that can simulate different weather conditions and additional planes in the sky.

Identify three pieces of information that would need to be researched in order to design this simulator.

[3]
(b). Explain what is meant by ‘concurrent processing’ and describe one example of how the simulator could make
use of it.

Concurrent processing

Example

[4]

© OCR 2018. You may photocopy this page. 7 of 58 Created in ExamBuilder


7. The layout for a 2-player board game is shown in Fig 2.1

The game is played by rolling two 6-sided dice and moving that number of spaces. Both players start on the
START space. If a player lands on a space occupied by the other player, they move to the next available space.

The board is to be stored as a 2-dimensional array.

The programmer has been told the recursive function has the Big O notation of O(n).

(i) State the purpose of Big O notation.

[1]

(ii) Explain what the Big O notation O(n) means for this recursive function.

[1]

© OCR 2018. You may photocopy this page. 8 of 58 Created in ExamBuilder


8. DriveSim Tutor is a 3D driving simulator program designed to allow learner drivers to practice following the
Highway Code whilst driving through a virtual town.

The simulator’s developers study a real town. They then use abstraction on their findings before designing a
virtual town.

A road in the town has a "no overtaking“ sign.

Describe how the simulator would check the driver obeys this sign whilst on this road.

[3]

© OCR 2018. You may photocopy this page. 9 of 58 Created in ExamBuilder


9(a). The Towers of Hanoi is a classic puzzle. Disks are placed in order on a pole, the biggest disc at the bottom of
the pole, the smallest disk at the top of the pole, on the first of three poles. The challenge is to get them to the
third pole in the same order.

The disks can only be moved under the following rules:

only one disk can be moved at a time


a disk can only ever be placed on an empty pole or on top of a larger disk
a larger disk can never be placed on a smaller disk.

© OCR 2018. You may photocopy this page. 10 of 58 Created in ExamBuilder


Each disk can be represented by an integer denoting its size.

So

Can be represented by

(i) Explain why you would use a stack rather than a queue to store the configuration of disks at each pole.

[2]

(ii) The tower class has the method push. It takes in the value of the disk to be pushed. It adds it to the top of
the stack if it is a valid move. If it is not a valid move, the value of the disc is not added and the message ‘
Invalid move’ is printed to the screen.

The stack is implemented using an array called pole and an integer called pointer. Pointer represents the
index of the array position at the top of the stack.

© OCR 2018. You may photocopy this page. 11 of 58 Created in ExamBuilder


Write the pseudocode to go in the push method. Annotate your pseudocode with comments to show how it
solves the problem. You are not expected to test for overflow.

[6]

© OCR 2018. You may photocopy this page. 12 of 58 Created in ExamBuilder


(b). One way to try to find a solution would be to generate a tree of possible moves until a solution is found.

(i) A tree has been started below. Complete Layer 3 to show 4 possible moves.

[4]

(ii) The search space represented by the tree could be searched using a depth first or breadth first search.

Describe one advantage and one disadvantage of depth-first search compared with breadth-first search.

Advantage:

Disadvantage:

[4]

© OCR 2018. You may photocopy this page. 13 of 58 Created in ExamBuilder


(c). Rather than using a tree, the following iterative algorithm can be used to play the perfect game where the
number of disks is odd. A similar algorithm exists for an even number of disks. A program is required to solve the
Towers of Hanoi puzzle using the iterative algorithm below.

© OCR 2018. You may photocopy this page. 14 of 58 Created in ExamBuilder


999 if the tower is empty.

The method removes a disk from a tower and returns the value of that disk.

e.g. would make x equal to 2 and the towers stay the same.

would make x equal to 2 and remove 2 from tower1.

Complete the pseudocode program below so when given an odd number of disks, below 100, on tower1 they will
be moved to tower3 using the iterative algorithm. Annotate your pseudocode with comments to show how it
solves the problem.

Iterative algorithm to solve Towers of Hanoi for an odd number of disks.

Cycle through the following three steps until the puzzle is solved (which may be after any of the steps):

make the valid move between tower1 and tower3


© OCR 2018. You may photocopy this page. 15 of 58 Created in ExamBuilder
make the valid move between tower1 and tower2
make the valid move between tower3 and tower2
[10]

© OCR 2018. You may photocopy this page. 16 of 58 Created in ExamBuilder


(d). The complexity of solving the Towers of Hanoi can be expressed in Big O notation as O(2n) where n is the
number of disks.

(i) A given computer takes 8 milliseconds (ms) to solve a 3 disk problem. Calculate how long the computer
takes to solve a 5 disk problem.

[1]

(ii) State one reason why the answer given for part (i) may only be an estimate.

[1]

(iii) Complete the graph below to show an estimate of how long a computer would take to solve the Towers of
Hanoi with a variable number of discs.

[2]

© OCR 2018. You may photocopy this page. 17 of 58 Created in ExamBuilder


(e). * Concurrency can be used to speed up the processing of some problems.

Discuss to what extent concurrency might be of use when solving the Towers of Hanoi puzzle. You should
consider both the search space tree and iterative algorithm approaches in your answer.

[9]

© OCR 2018. You may photocopy this page. 18 of 58 Created in ExamBuilder


10. State the three basic programming constructs used to control the flow of execution, giving your own example of
each.

Example _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Example _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Example _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

[6]

© OCR 2018. You may photocopy this page. 19 of 58 Created in ExamBuilder


11. A cruise liner company has to produce daily documentation for passengers. The passengers speak a number of
different languages. Currently, bilingual members of the crew translate and type different versions of
documentation. The company decides to automate the translation process.

The company's system analyst follows a systems lifecycle approach.

The next stage involves establishing the requirements from potential users.

Describe three methods that could be used to gather requirements in this scenario.

Method 1 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Method 2 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Method 3 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

[6]

© OCR 2018. You may photocopy this page. 20 of 58 Created in ExamBuilder


12(a). A car racing team uses a car simulator to test their drivers in a range of cars on different race tracks.

The car simulator uses an abstraction of the real car and race track. Identify two ways in which the simulator
could use abstraction.

[2]
(b). Identify three inputs that will be required to configure the initial conditions for running the simulation.

3
[3]

© OCR 2018. You may photocopy this page. 21 of 58 Created in ExamBuilder


13(a). Fig. 2.1 shows the flight paths between a country's airports. The value in bold beneath each node is the heuristic
value from E.

State the full name of the data structure shown in Fig. 2.1.

[2]
(b). The structure in Fig. 2.1 is searched using the A* algorithm making use of the heuristic values.

(i) State what the heuristic values could represent in Fig. 2.1.

[1]

(ii) State the purpose of heuristic values in the A* algorithm.

[1]

(iii) Perform an A* algorithm on the data structure in Fig. 2.1 to find the shortest distance between H and E.
Show each step of the process, and the calculations performed for each node visited.

© OCR 2018. You may photocopy this page. 22 of 58 Created in ExamBuilder


[8]

(iv) Give one decision that is made in the A* algorithm, and describe the effect of this decision on the next
step(s) of the algorithm.

Decision _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Effect _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

[3]

© OCR 2018. You may photocopy this page. 23 of 58 Created in ExamBuilder


(c). *A programmer is interested in using concurrent processing to perform a searching algorithm.

Explain how concurrent processing could be used in searching algorithms, and evaluate the benefits and trade-
offs from implementing concurrent processing in a searching algorithm.

[9]

© OCR 2018. You may photocopy this page. 24 of 58 Created in ExamBuilder


14. Dexter is leading a programming team who are creating a computer program that will simulate an accident and
emergency room to train hospital staff.

Dexter has been told he should make use of caching in the simulation.

Describe what is meant by caching and explain how caching can be used within the simulation.

[4]

© OCR 2018. You may photocopy this page. 25 of 58 Created in ExamBuilder


15(a). Kim is writing an object-oriented program for a four player board game. The board has 26 squares that players
move around, as shown in Fig. 5.1.

Fig. 5.1

Each player takes it in turn to roll two dice. They then move that number of spaces on the board. If they roll a
double (both dice have the same value), they then take a card from the deck. The deck contains 40 cards that
each include a sentence (such as "You have won the lottery“). The sentence on the card determines if money is
given or taken away from the player.

© OCR 2018. You may photocopy this page. 26 of 58 Created in ExamBuilder


Fig. 5.2

Each square (apart from Start and Miss a turn) has an animal associated with it that the player can purchase, if it
has not been purchased already, for example square 6 has a Squirrel. Fig. 5.2 shows an example of one of
these animals. Once a player has purchased the animal, any opposing player which subsequently lands on the
square/animal has to pay a fine.

Each animal can be upgraded, with each upgrade the game charges more each time a player stops on them. For
example, with no upgrade the level 0 squirrel costs £10 when a player stops on it. If £1000 is paid to upgrade,
the squirrel is then a level 1 animal and now charges £50 for a stop.

The cost to purchase and upgrade the animal is the same.

Each animal can be upgraded to a maximum of level 3.

When a player lands on, or passes the square ‘Start’ (position 0), they receive £500. If they land on ‘Miss a turn’
(position 13), they miss their next turn.

(i) A class, Player, stores the player's ID (P1, P2, P3, P4), their current board position and the amount of money
they have.

Fig. 5.3 shows a class diagram for Player. A class diagram describes a class. It contains the class name,
followed by the attributes, then the methods.

© OCR 2018. You may photocopy this page. 27 of 58 Created in ExamBuilder


Fig. 5.3

The constructor creates a new instance of Player, taking the player's ID as a parameter. The board position is
set to 0, and money to £2000.

Write, using pseudocode, the constructor method for the Player class.

[3]

(ii) A class, Animal, define the attributes and methods for the animals stored in each square.
Fig. 5.4 shows a class diagram for Animal.

© OCR 2018. You may photocopy this page. 28 of 58 Created in ExamBuilder


Fig. 5.4

The constructor takes the required data as parameters and then sets currentLevel to 0, and assigns the
parameters as the remaining attributes for the new object.

Write, using pseudocode, the constructor method for the Animal class.

[4]

© OCR 2018. You may photocopy this page. 29 of 58 Created in ExamBuilder


(iii) Write, using pseudocode, the code to create an instance of Animal for the Squirrel shown in Fig. 5.2,
positioned on square number 6, for the constructor function you wrote in part (a)(ii).

[2]

(b). The board is stored as a 1D array, board, of data type Animal. The spaces at 0, and 13, are left as empty
elements that are checked using separate functions.

(i) Complete, using pseudocode, the function to:

Roll both dice


Move the player, the dice number of spaces
If a double is rolled, calls the procedure pickDeck
Adds £500 if they have passed or landed on Start
Calls the procedure missAGo if they land on space 13 or
Calls the procedure checkAnimal
Return the new position

© OCR 2018. You may photocopy this page. 30 of 58 Created in ExamBuilder


[6]

(ii) *The parameter currentPlayer from part (b)(i) can be passed by value or by reference.

Explain the difference, benefits and drawbacks between passing by value and by reference. Recommend
which should be used for currentPlayer, justifying your decision.

© OCR 2018. You may photocopy this page. 31 of 58 Created in ExamBuilder


[9]

(c). The deck is stored as a zero-indexed 1D array, named deck, of type Card.

The class diagram for Card is shown in Fig. 5.5.

© OCR 2018. You may photocopy this page. 32 of 58 Created in ExamBuilder


Fig. 5.5

The array, deck, is treated as a queue, with a variable, headPointer, identifying the first card in the deck. When a
card has been used, the head pointer increases to move to the next position. If the end of the deck is reached,
the head pointer returns to 0 and starts again.

The procedure pickDeck:

takes the current player as a parameter


outputs the text to be displayed from the first card in the queue
adds or subtracts the amount to/from the current player's money
increases the head pointer

Write, using pseudocode, the procedure pickDeck.

[6]

© OCR 2018. You may photocopy this page. 33 of 58 Created in ExamBuilder


(d). The procedure checkAnimal:

Takes the current player as a parameter


Accesses the data for the animal at the player's position in the array board
If the animal is free, asks the player if they would like to purchase the animal and outputs its name and cost, if
they choose to buy the animal, it calls the procedure purchase() with the player and animal as parameters
If that player owns the animal, and it is not at level 3, it asks if they would like to upgrade the animal
If they would like to upgrade, it calls the method upgrade for that animal with the current player as a
parameter
If a different player owns the animal, it calls the method getAmountToCharge() for that animal, sending this
value and the current player as parameters to the procedure chargeStay()

Write, using pseudocode, the procedure checkAnimal.

[10]

© OCR 2018. You may photocopy this page. 34 of 58 Created in ExamBuilder


END OF QUESTION PAPER

© OCR 2018. You may photocopy this page. 35 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

1 Barcode of item purchased is read at 6 Note: This is intended to be a difficult


checkout / it is scanned in question.
Barcode is compared with barcodes Mark points need to be fairly precise – do
stored on stock file not read too much into a response
(Field containing) number of tins of
beans is decremented Examiner's Comments
New value is compared with the field
containing the minimum number of tins There were some comprehensive
of beans that are allowed responses here, while many good answers
If number of tins in stock is less than were spoiled because the process
minimum stock / value is below limit… described did not consider the need to
…and no order is outstanding for this avoid automatically ordering more tins after
item… every tin is sold. Few were unable to earn
…search supplier file for details of some credit even if it was only for scanning
supplier and use these details either to the tins when sold. This proved to be an
place an order automatically or excellent discriminator question. This
produce report for manager question was an ideal question to be
Set field showing outstanding order answered as a series of numbered points,
When order arrives, number in stock answering in this way could have helped
(field) is incremented some candidates arrange their thoughts in
what is a sequential process.

Total 6

2 * Mark Band 3–High Level 9 AO1: Knowledge and Understanding


(7–9 marks) The following is indicative of possible
The candidate demonstrates thorough factors / evidence that candidates may
knowledge and understanding of reasons refer to but is not prescriptive or
why Nobugs enforces standard rules about exhaustive:
writing functions on its programmers; the
material is generally accurate and detailed. No function may be longer than a
The candidate is able to apply their single page of code: this is to reduce
knowledge and understanding directly and complexity and aid readability.
consistently to the context provided. Variable identifiers must conform to a
Evidence / examples will be explicitly standard convention: this helps others
relevant to the explanation. The candidate to understand the code and reduces
provides a thorough discussion which is the likelihood of duplication, makes
well-balanced. Evaluative comments are maintenance easier.
consistently relevant and well-considered. Each function must have a single entry
point: this reduces complexity and
There is a well-developed line of reasoning makes the search for any bugs more
which is clear and logically structured. The straightforward.
information presented is relevant and Variables must not be set up outside
substantiated. the scope of a function: this sets a limit
on where to look for bugs and reduces
Mark Band 2–Mid Level the likelihood of a problem spread
across many modules.
(4–6 marks)
The candidate demonstrates reasonable
AO2.1: Application
knowledge and understanding of reasons
The selected knowledge / examples should

© OCR 2018. You may photocopy this page. 36 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance


why Nobugs enforces standard rules about be directly related to the specific question.
writing functions on its programmers; the The following is indicative of possible
material is generally accurate but at times factors / evidence that candidates may
underdeveloped. refer to but is not prescriptive or
The candidate is able to apply their exhaustive:
knowledge and understanding directly to
the context provided although one or two Explanation of how the standard rules
opportunities are missed. Evidence / for programming would impact upon
examples are for the most part implicitly the choices made for using functions
relevant to the explanation. and variables and how they are
addressed.
The candidate provides a reasonable Discussion around the use of different
discussion, the majority of which is functions and variables that are
focused. Evaluative comments are for the dependent, independent or
most part appropriate, although one or two interdependent.
opportunities for development are missed.
AO3.3: Evaluation
There is a line of reasoning presented with Candidates will need to consider a variety
some structure. The information presented of viewpoints in relation to following
is in the most part relevant and supported standard rules for functions and variables
by some evidence. while developing management software
and will make evaluative comments about
Mark Band 1–Low Level the issues and solutions they are
(1–3 marks) discussing e.g.
The candidate demonstrates a basic
knowledge of reasons why an organisation Why using functions longer than one
enforces standard rules about writing page of code will increase complexity?
functions on its programmers with limited Why hardware-specific code must be
understanding shown; the material is basic avoided?
and contains some inaccuracies. The Why variables must not be setup
candidate makes a limited attempt to apply outside the scope of a function?
acquired knowledge and understanding to How a single entry point reduces
the context provided. complexity and makes the search for
any bugs more straightforward?
The candidate provides a limited What will happen if embedded
discussion which is narrow in focus. documentation is not adequate?
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.

© OCR 2018. You may photocopy this page. 37 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

Total 9

© OCR 2018. You may photocopy this page. 38 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

3 a Target temperature (1 – AO 2.1) 8 Up to 4 marks (AO 2.1) one mark for each
integer / floating point (1 – AO 3.1). correct identification of input.
Wheel movement (1 – AO 2.1) Boolean
Up to 4 marks (AO 3.1) one mark for
(1 – AO 3.1).
identifying the correct data type.
Engine running (1 – AO 2.1) Boolean
(1 – AO 3.1). Any example of driver choices / settings
Internal temperature (1 – AO 2.1) related to something switched on (1 – AO
integer / floating point (1 – AO 3.1). 2.1)
External temperature (1 – AO 2.1) Boolean (1 – AO 3.1).
integer / floating point (1 – AO 3.1). Any example of driver choices / settings
External light level (1 – AO 2.1) integer related to a level being set (1 – AO 2.1)
/ floating point (1 – AO 3.1). integer / floating point (1 – AO 3.1).
Heating on (1 – AO 2.1) Boolean (1 –
AO 3.1).
Air conditioning on (1 – AO 2.1)
Boolean (1 – AO 3.1).
Gears engaged (1 – AO 2.1) Boolean
(1 – AO 3.1).

b Start engine (1), stop engine (1), signal 2 1 mark for each correct identification up to
to dashboard display (1). a maximum of two identifications.

Total 10

4 Popularity data (1). 4 1 mark for each correct identification up to


Platforms available (1). a maximum of four identifications.
Sales of existing similar apps (1).
Prices charged (1).
Does it exist already? (1).

Total 4

© OCR 2018. You may photocopy this page. 39 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

5 a Look for processes that can be 4 Up to 4 marks for a valid explanation.


processed at the same time (1)
processes that must be sequential (1). Allow any correct examples for the last 2
Example of possible parallel mark points.
processes, e.g. windows installed at
same time as electrics / plumbing (1).
Example of an obligatory sequence
e.g. rafters installed before tiles put on
/ walls before roof (1).

b Instruction processing (1) – some 4 1 mark for each correct identification up to


processors allow parts of instructions a maximum of two identifications plus up to
to be processed (1) without waiting to a further 1 mark for each of two valid
complete the whole instruction cycle descriptions.
(1).
Pipes to pass data between programs
(1) from programs to peripherals / to
programs from peripherals (1),
example such as | symbol in Unix, or
Popen() or pipe() in C (1).
Graphics pipelines (1) separate
processor renders graphics from data
supplied by other processes (1), parts
(vertices) of the image are pipelined at
the same time as custom software
(shader) that renders the display (1).

Total 8

© OCR 2018. You may photocopy this page. 40 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

6 a 1 mark per data item, accept any 3


appropriate, sensible suggestions

Number of other planes that could be


in the sky (1)
Speed (1)
Flight path (1)
Altitudes (1)
Rate of acceleration (1)

b Max 1 for explanation of concurrent 4 Accept any reasonable suggestion for


programming. concurrent programming in the simulator
Max 3 for each example.
For examples:
Concurrent processing: 1 mark for identifying example.
1 mark for saying how they act
One process does not have to finish concurrently.
before the other starts (1) 1 mark for saying why this is necessary.

Example e.g.

Each plane can move independently


(1)
All move at the same time (1)
All need to react to different events (1)
The weather (1)
Wind, rain, direction of air etc. (1)
Each element needs to be run
simultaneously (1)
It will react to its own stimulii (1)

Total 7

7 i 1 from 1

Evaluate the complexity of the


algorithm (1)
Show how the time / memory /
resources increase as the data size
increases (1)
Evaluate worst case scenario for the
algorithm (1)

ii As the dice number increases, the time 1


the function takes to run increases
proportionally / linearly (1)

Total 2

© OCR 2018. You may photocopy this page. 41 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

8 Have a Boolean variable for if user has 3 Up to 3 marks for a valid description.
obeyed this rule (1) and set it to true
(1).
Check if on the no overtaking section
of road (1).
When entering this section make note
of the car immediately in front (1).
If the position of this car becomes
behind the user set a flag that this rule
has been broken (1) / alert the user
that rule has been broken (1).
Continue checking until left the
overtaking section (1).

Total 3

© OCR 2018. You may photocopy this page. 42 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

9 a i A disk can only be put onto the top of 2 Up to 2 marks for a valid explanation.
the pole (1) and a stack is a last in first
out structure (1) whereas a queue is
first in first out (1).

ii Individual steps in pseudocode: 6 Up to 3 marks for valid pseudocode


(AO3.2).

Checks if pointer is 0 (i.e. pointer is 0) Up to 3 marks for annotated comments


Checks if the disk being added is used (AO2.2).
smaller than the one at the top of the
pole Example pseudocode:
Puts diskValue at the top of stack
Move the pointer up one
If it's not a valid move, no disk is added
…and prints Invalid move

Programming marks to be awarded as


follows: Example of pseudocode with comments in
code for guidance:

Checks if pointer is 0 and checks if the


disk being added is smaller than the
one at the top of the pole (1 – AO 3.2).
Puts diskValue at the top of stack and
moves the pointer up one (1 – AO 3.2).
If it's not a valid move, no disk is added
and prints Invalid move (1 – AO 3.2).

Possible annotated comments:

The IF statement checks the pointer


value is 0 so we can assume the disk
is available to be moved (1 – AO 2.2).
If these conditions are met then pole
value is set to the diskValue and
incremented by 1 so the disk can move
to the next pole (1 – AO 2.2).
If these conditions are not met then the
else prints Invalid move (1 – AO 2.2).

© OCR 2018. You may photocopy this page. 43 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

b i Left hand boxes, any 2 of: 4 For 4 marks as indicated.

(1 Mark each, Max 2)

Right hand boxes, any 2 of:

(1 Mark each, Max 2)

ii Depth first advantage: 4 Up to 4 marks for a valid description.

Depth first requires less memory than


breadth first search (1). It is quicker if
you are looking at deep parts of the
tree (1).

Depth first disadvantage:

Depth first isn't guaranteed to find the


quickest solution (1) and possibly may
never find the solution (1) if we don't
take precautions not to revisit
previously visited states (1).

© OCR 2018. You may photocopy this page. 44 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

c Individual steps in pseudocode: 10 Up to 6 marks for valid pseudcode (AO3.2)


Up to 4 marks for annotated comments
Makes a swap between 1 and 3 used (AO2.2).
…and always makes a valid swap.
Then makes a swap between 1 and 2. Example pseudocode:
…And always makes a valid swap
…only if the problem is not solved.
Repeats if not solved.
Will not attempt to make a swap between 2
empty towers.

Programming marks to be awarded as


follows:

Makes a swap between pole 1 and 3 (1


– AO 3.2).
Checks for a valid move throughout (1
– AO 3.2).
Makes a swap between pole 1 and 2 (1
– AO 3.2).
Checks whether problem is solved
throughout (1 – AO 3.2).
Makes a swap between 3 and 2 (1 –
AO 3.2).
Repeats if not solved and will not
attempt a swap between two empty
towers. (1 – AO 3.2).

Possible annotated comments:

The loop checks if towers 1 or 2 have


anything on them. If they do the
problem is not solved as all the disks
need to be on pole 3. (1 – AO 2.2).
The first selection (if) makes a swap
between 1 and 2 and always makes a
valid swap only if the problem is not
solved. (1 – AO 2.2).
The second selection (if) makes a
swap between 3 and 2 and always
makes a valid swap only if the problem
is not solved. (1 – AO 2.2).
A swap is only valid if the pole is either
empty or the disk on which it is to be
put is a larger number (1 – AO 2.2).

© OCR 2018. You may photocopy this page. 45 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

d i 32 ms (1) 1 For one mark.

ii Big O notation shows the limiting behaviour 1 For one mark.


of an algorithm (to classify its complexity)
(1).

Other processes may be taking up


some of the processor time (1).

iii Exponential curve drawn (1). 2 For two marks.

Curve passes 100 on the y axis before x


reaches 8 (1).

e Mark Band 3–High Level 9 If only search space tree or iterative


(7–9 marks) algorithm approaches considered –
The candidate demonstrates thorough MAX 5 marks.
knowledge and understanding of
concurrency including considerations of the AO1: Knowledge and Understanding
search space tree and iterative algorithm Indicative Content:
approaches; the material is generally
accurate and detailed. The following is indicative of possible
The candidate is able to apply their factors / evidence that candidates may
knowledge and understanding directly and refer to but is not prescriptive or
consistently to the context provided. exhaustive:
Evidence / examples will be explicitly
relevant to the explanation.
The candidate provides a thorough Concurrency could be used with the
discussion which is well–balanced. search tree.
Evaluative comments are consistently Different processors could generate
relevant and well–considered. the subtrees of different nodes until the
correct answer is found.
With the iterative algorithm each stage
There is a well–developed line of reasoning
depends on the previous one meaning
which is clear and logically structured. The
it is not possible to use concurrent
information presented is relevant and
processing to speed up the process.
substantiated.
Because of the exponential complexity
as n increases concurrent processing
Mark Band 2–Mid Level
becomes less practical.
(4–6 marks)

© OCR 2018. You may photocopy this page. 46 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance


AO2.1: Application
The candidate demonstrates reasonable The selected knowledge / examples should
knowledge and understanding of be directly related to the specific question.
concurrency including considerations of the The following is indicative of possible
search space tree and iterative algorithm factors / evidence that candidates may
approaches; the material is generally refer to but is not prescriptive or
accurate but at times underdeveloped. exhaustive:
The candidate is able to apply their
knowledge and understanding directly to
the context provided although one or two Discussions around abstraction and
opportunities are missed. Evidence / modelling.
examples are for the most part implicitly Discussions around the preconditions
relevant to the explanation. The candidate and how these will be applied.
provides a reasonable discussion, the Discussions around identifying the
majority of which is focused. Evaluative components of the problem and how
comments are for the most part concurrency might be used.
appropriate, although one or two Discussions around order of steps and
opportunities for development are missed. sub processes.
Discussion around the flow of the
There is a line of reasoning presented with program and the decisions taken and
some structure The information presented how this effects the use of
is in the most part relevant and supported concurrency.
by some evidence.
AO3.3: Evaluation
Mark Band 1–Low Level Candidates will need to consider a variety
(1–3 marks) of factors in relation to the question and will
The candidate demonstrates a basic make some evaluative comments about
knowledge of concurrency with limited the issues and solutions they are
understanding shown; the material is basic discussing. The following is indicative of
and contains some inaccuracies. The possible factors / evidence that candidates
candidate makes a limited attempt to apply may refer to but is not prescriptive or
acquired knowledge and understanding to exhaustive:
the context provided.

The candidate provides a limited Discussions of the features and how


discussion which is narrow in focus. the different approaches are more or
Judgments if made are weak and less suitable for a solution.
unsubstantiated. Discussions of the essential features of
the solutions and the differences
The information is basic and between them with discussion of the
communicated in an unstructured way. The limitations.
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.

© OCR 2018. You may photocopy this page. 47 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

Total 39

10 Iteration … 6 Do not accept ‘loop’


… Example should be either a FOR,
WHILE or REPEAT … UNTIL All examples must be code, do not credit
Selection … explanations.
Allow examples from given code
… Example should be either an IF,
SWITCH, CASE or SELECT
Examiner's Comments
Sequence …
… Example should be at least two This was largely well answered, though
consecutive lines of code some of the code examples for iteration
were for infinite loops.

Total 6

11 □ Questionnaire… [1] 6
□ …set of questions given out to Examiner's Comments
potential users to fill in and return [1]
Most candidates could state three methods
□ Interview… [1] for gathering requirements but in some
cases descriptions lacked clarity.
□ …face to face discussions where
potential users are asked questions. [1]

□ Observation… [1]
□ …Where users of the existing system
are observed using it. [1]

□ Meeting… [1]
□ …Group of users sit down with
analyst to discuss current system [1]
□ Existing documentation… [1]
□ …used in the system is examined [1]

(Max 3 for methods named, Max 3 for


their descriptions)

Total 6

© OCR 2018. You may photocopy this page. 48 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

12 a e.g. 2 Accept any reasonable answer

Examiner's Comments
Reduces track scenery
Limited functionality on car dashboard Many candidates confused the concept of
Simplified controls abstraction (simplification) with the
Simplified physics requirement to make a genuinely realistic
Simplified / removed weather simulation.

b e.g. 3 Allow any reasonable alternative

Examiner's Comments
Track name
Car type Many candidates answered well, but some
Driver name misread the question and identified input
devices that could be used within the
simulation, rather than initial starting
parameters as required.

Total 5

© OCR 2018. You may photocopy this page. 49 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

13 a 1 mark per bullet 2

Weighted/Undirected
Graph

b i E.g. Weighting/cost based on estimated 1


distance from final node

ii Used to speed up process of finding 1


solution

iii 1 mark per bullet, max 7 for 8


calculations/explanation, max 1 for correct
final path

Visiting H with correct heuristic


Visiting G and N from H
Calculating correct
distance+heuristic for G and N
Identifying G as the smallest value
Visiting L and M from G
Calculating distance+heuristic for L
and M
Identifying L as the smallest value
Visiting E
Calculating distance+heuristic for E
Final path: H-G-L-E

e.g.

© OCR 2018. You may photocopy this page. 50 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

iv 1 mark for decision, 2 marks for effect 3


e.g.
Decision:

Choosing which node to take next


The shortest distance+heuristic is
taken

Effect:

All adjoining nodes from this new node


are taken
Other nodes are compared again in
future checks
Assumed that this node is a shorter
distance
Adjoining nodes may not be shortest
path …
….may need to backtrack to previous
nodes

c Mark Band 3 – High level (7-9 marks) 9 AO1: knowledge and understanding
The candidate demonstrates a thorough Indicative content
knowledge and understanding of
concurrent processing; the material is
generally accurate and detailed. Carrying out more than one task at a
The candidate is able to apply their time
knowledge and understanding directly and Multiple processors
consistently to the context provided Each processor performs
(searching algorithms). simultaneously
Evidence/examples will be explicitly Each processor performs tasks
relevant to the explanation. independently
The candidate provides a thorough
discussion which is well balanced. and/or
Evaluative comments are consistenly
relevant and well considered.
A program has multiple threads
There is a well-developed line of reasoning Each thread starts and ends at
which is clear and logically structured. The different times
information presented is relevant and Each thread overlaps
substantiated. Each thread runs independently

Mark Band 2 – Mid level (4-6 marks) AO2: Application


The candidate demonstrates reasonable
knowledge and understanding of
concurrent processing; the material is Each processor/thread performs a
generally accurate but at times search in a different direction

© OCR 2018. You may photocopy this page. 51 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance


underdeveloped. Rather than going down one path, go
The candidate is able to apply their down 2+
knowledge and understanding directly to E.g. apply different searches
the context provided although one or two simultaneously - perform breadth- first
opportunities are missed. (searching and depth-first simultaneously
algorithms) Evidence/examples are for the E.g. A* take the two shortest routes at
most part implicitly relevant to the each decision point, update same table
explanation. Linear search can have multiple
The candidate provides a reasonable processors searching different areas at
discussion, the majority of which is the same time.
focused. Evaluative comments are, for the Binary search doesn't benefit from an
most part appropriate, although one or two increase in speed with additional
opportunities for development are missed. processors.
There is a line of reasoning presented with
some structure. The information presented AO3: Evaluation
is in the most part relevant and supported Candidates will need to evaluate the
by some evidence benefits and drawbacks of concurrent
processing in searching e.g.
Mark Band 1 – Low Level (1-3 marks)
The candidate demonstrates a basic
knowledge of concurrent processing with Possibly find solution faster
limited understanding shown; the material Takes up more memory
is basic and contains some inaccuracies. Increase program throughput
The candidates makes a limited attempt to May waste time investigating inefficient
apply acquired knowledge and solutions
understanding to the context provided More difficult to program especially to
(searching algorithms). cooperate
The candidate provides a limited More memory intensive
discussion which is narrow in focus. Linear search scales very with
Judgements if made are weak and additional processors
unsubstantiated. Binary search can perform better on
The information is basic and comunicated large data sets with one processor than
in an unstructured way. The information is linear search with many processors
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.

Total 24

© OCR 2018. You may photocopy this page. 52 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

14 2 marks for definition, max 2 for application 4 Allow any reasonable example
Caching: A well-developed example can gain two
marks

Data that has been used is stored in


cache/ram in case it is needed again
Allows faster access for future use

Application:
e.g.

Store patients'
details/conditions/appearance
Design of people in the simulation
Design of specific rooms

Total 4

© OCR 2018. You may photocopy this page. 53 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

15 a i 1 mark per bullet to max 3 3

Declaring the procedure and taking a


player ID as parameter
Setting playerID to parameter
Setting boardPosition to 0 and money
to 2000

e.g.

ii 1 mark per bullet to max 4 4

Declaration as public and procedure,


named constructor/new and Taking all
correct parameters (missing
currentLevel)
Sets currentLevel to 0
Setting all the data…
…to the matching parameters taken

iii 1 mark per bullet to max 2 2

Creating new instance e.g. squirrel =


new Animal
Parameters matching part (b)(i)

e.g.

© OCR 2018. You may photocopy this page. 54 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

b i 1 mark for each correctly completed space 6

© OCR 2018. You may photocopy this page. 55 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

ii Mark Band 3 – High level (7-9 marks) 9 AO1: Knowledge and Understanding
The candidate demonstrates a thorough Indicative content
knowledge and understanding of passing By Value
values by reference and by value; the
material is generally accurate and detailed.
The candidate is able to apply their sends the actual value
knowledge and understanding directly and if changes are made then only the local
consistently to the context provided. copy is amended
Evidence/examples will be explicitly
relevant to the explanation. The candidate By Reference
provides a thorough discussion which is
well balanced. Evaluative comments are
consistently relevant and well considered sends a pointer to the value
There is a well-developed line of reasoning The actual value is not sent/received
which is clear and logically structured. The If changed the original is also changed
information presented is relevant and when the subroutine ends
substantiated.
AO2: Application
Mark Band 2 – Mid level (4-6 marks)
The candidate demonstrates reasonable Send by value
knoledge and understanding of passing The currentPlayer value is not /does
values by reference and by value; the not need to be changed in the
material is generally accurate but at times subprogram
underdeveloped. Send by reference
The candidate is able to apply their The currentPlayer value is updated
knowledge and understanding directly to
the context provided although one or two AO3: Evaluation
opportunities are missed.
Evidence/examples are for the most part ByValue creates new memory space…
implicitly relevant to the explanation. ByReference means existing memory
The candidate provides a reasonable space is used
discussion, the majority of which is Depends if original variable is
focused. Evaluative comments are, for the local/global
most part appropriate, although one or two If local and just referenced, send by
opportunities for development are missed. value
There is a line of reasoning presented with If original value needs editing send by
some structure. The information presented reference
is in the most part relevant and supported If passing by reference then instead of
by some evidence returning position the code could just
amend currentPlayer.position
If passing by value there could be
inconsistencies when currentPlayer is
passed to other methods, for example
pickDeck

Mark Band 1 – Low Level (1-3 marks)


The candidate demonstrates a basic
knowledge of passing values by reference
and by value with limited understanding

© OCR 2018. You may photocopy this page. 56 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance


shown; the material is basic and contains
some inaccuracies. The candidates makes
a limited attempt to apply acquired
knowledge and understanding to the
context provided.
The candidate provides a limited
discussion which is narrow in focus.
Judgements if made are weak and
unsubstantiated.
The information is basic and comunicated
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.

c 1 mark per bullet to max 6 6

Procedure declaration with correct


name and parameter
Outputting the correct text from deck at
headPointer
Sending to currentPlayer.setMoney …
getMoney + deck at head pointer
amount
Increase the head pointer
Set headPointer to 0 if position 40 or
greater

© OCR 2018. You may photocopy this page. 57 of 58 Created in ExamBuilder


Mark Scheme

Question Answer/Indicative content Marks Guidance

d 10 Allow follow through for incorrect accessing


of methods
Declaring the procedure with correct
parameters

Check if the space/animal is free

If free, outputting name and cost

Checking if they want to buy

Calling purchase with current


player and animal

If they own the animal, checking if they


can upgrade

If they can, asking if they want to


upgrade outputting the cost

If they want to, calling the upgrade


method

If they don't own the animal

Calling chargeStay with the amount


to charge and the current player

Total 40

© OCR 2018. You may photocopy this page. 58 of 58 Created in ExamBuilder

Powered by TCPDF (www.tcpdf.org)

You might also like