Professional Documents
Culture Documents
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]
[9]
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.
[8]
(b). Identify two outputs from this engine management feature.
[2]
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]
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]
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]
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 programmer has been told the recursive function has the Big O notation of O(n).
[1]
(ii) Explain what the Big O notation O(n) means for this recursive function.
[1]
The simulator’s developers study a real town. They then use abstraction on their findings before designing a
virtual town.
Describe how the simulator would check the driver obeys this sign whilst on this road.
[3]
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.
[6]
(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]
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.
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.
Cycle through the following three steps until the puzzle is solved (which may be after any of the steps):
(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]
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]
Example _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Example _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Example _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[6]
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]
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]
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]
[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.
(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]
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]
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]
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.
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.
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.
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.
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]
[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.
(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.
(c). The deck is stored as a zero-indexed 1D array, named deck, of type Card.
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.
[6]
[10]
Total 6
0 marks
No attempt to answer the question or
response is not worthy of credit.
Total 9
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
Total 4
Total 8
Example e.g.
Total 7
7 i 1 from 1
Total 2
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
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).
0 marks
No attempt to answer the question or
response is not worthy of credit.
Total 39
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]
Total 6
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.
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
Weighted/Undirected
Graph
e.g.
Effect:
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
0 marks
No attempt to answer the question or
response is not worthy of credit.
Total 24
14 2 marks for definition, max 2 for application 4 Allow any reasonable example
Caching: A well-developed example can gain two
marks
Application:
e.g.
Store patients'
details/conditions/appearance
Design of people in the simulation
Design of specific rooms
Total 4
e.g.
e.g.
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
0 marks
No attempt to answer the question or
response is not worthy of credit.
Total 40