Oxford Cambridge and RSA Examinations
GCE
Computer Science
H446/02: Algorithms and programming
Advanced GCE
Mark Scheme for Autumn 2021Oxford Cambridge and RSA Examinations
OCR (Oxford Cambridge and RSA) is a leadi
...
Oxford Cambridge and RSA Examinations
GCE
Computer Science
H446/02: Algorithms and programming
Advanced GCE
Mark Scheme for Autumn 2021Oxford Cambridge and RSA Examinations
OCR (Oxford Cambridge and RSA) is a leading UK awarding body, providing a wide range of
qualifications to meet the needs of candidates of all ages and abilities. OCR qualifications
include AS/A Levels, Diplomas, GCSEs, Cambridge Nationals, Cambridge Technicals,
Functional Skills, Key Skills, Entry Level qualifications, NVQs and vocational qualifications in
areas such as IT, business, languages, teaching/training, administration and secretarial skills.
It is also responsible for developing new specifications to meet national requirements and the
needs of students and teachers. OCR is a not-for-profit organisation; any surplus made is
invested back into the establishment to help towards the development of qualifications and
support, which keep pace with the changing needs of today’s society.
This mark scheme is published as an aid to teachers and students, to indicate the requirements
of the examination. It shows the basis on which marks were awarded by examiners. It does not
indicate the details of the discussions which took place at an examiners’ meeting before marking
commenced.
All examiners are instructed that alternative correct answers and unexpected approaches in
candidates’ scripts must be given marks that fairly reflect the relevant knowledge and skills
demonstrated.
Mark schemes should be read in conjunction with the published question papers and the report
on the examination.
© OCR 20211. Annotations
Annotation Meaning
Omission mark
Benefit of the doubt
Incorrect point
Follow through
Not answered question
No benefit of doubt given
Repeat
Correct point
Too vague
Level 1
Level 2
Level 32
2. Subject-specific Marking Instructions
INTRODUCTION
Your first task as an Examiner is to become thoroughly familiar with the material on which the examination depends. This material includes:
• the specification, especially the assessment objectives
• the question paper and its rubrics
• the mark scheme.
You should ensure that you have copies of these materials.
You should ensure also that you are familiar with the administrative procedures related to the marking process. These are set out in the OCR
booklet Instructions for Examiners. If you are examining for the first time, please read carefully Appendix 5 Introduction to Script Marking:
Notes for New Examiners.
Please ask for help or guidance whenever you need it. Your first point of contact is your Team Leader.USING THE MARK SCHEME
Please study this Mark Scheme carefully. The Mark Scheme is an integral part of the process that begins with the setting of the question paper and
ends with the awarding of grades. Question papers and Mark Schemes are developed in association with each other so that issues of
differentiation and positive achievement can be addressed from the very start.
This Mark Scheme is a working document; it is not exhaustive; it does not provide ‘correct’ answers. The Mark Scheme can only provide ‘best
guesses’ about how the question will work out, and it is subject to revision after we have looked at a wide range of scripts.
The Examiners’ Standardisation Meeting will ensure that the Mark Scheme covers the range of candidates’ responses to the questions, and that all
Examiners understand and apply the Mark Scheme in the same way. The Mark Scheme will be discussed and amended at the meeting, and
administrative procedures will be confirmed. Co-ordination scripts will be issued at the meeting to exemplify aspects of candidates’ responses and
achievements; the co-ordination scripts then become part of this Mark Scheme.
Before the Standardisation Meeting, you should read and mark in pencil a number of scripts, in order to gain an impression of the range of
responses and achievement that may be expected.
In your marking, you will encounter valid responses which are not covered by the Mark Scheme: these responses must be credited. You will
encounter answers which fall outside the ‘target range’ of Bands for the paper which you are marking. Please mark these answers according to the
marking criteria.
Please read carefully all the scripts in your allocation and make every effort to look positively for achievement throughout the ability range. Always
be prepared to use the full range of marks.4
LEVELS OF RESPONSE QUESTIONS:
The indicative content indicates the expected parameters for candidates’ answers, but be prepared to recognise and credit unexpected approaches
where they show relevance.
Using ‘best-fit’, decide first which set of BAND DESCRIPTORS best describes the overall quality of the answer. Once the band is located, adjust
the mark concentrating on features of the answer which make it stronger or weaker following the guidelines for refinement.
• Highest mark: If clear evidence of all the qualities in the band descriptors is shown, the HIGHEST Mark should be awarded.
• Lowest mark: If the answer shows the candidate to be borderline (i.e. they have achieved all the qualities of the bands below and show
limited evidence of meeting the criteria of the band in question) the LOWEST mark should be awarded.
• Middle mark: This mark should be used for candidates who are secure in the band. They are not ‘borderline’ but they have only achieved
some of the qualities in the band descriptors.
Be prepared to use the full range of marks. Do not reserve (e.g.) high Band 3 marks ‘in case’ something turns up of a quality you have not yet seen.
If an answer gives clear evidence of the qualities described in the band descriptors, reward appropriately.AO1 AO2 AO3
High (thorough) Precision in the use of question
terminology. Knowledge shown is
consistent and well-developed.
Clear appreciation of the question
from a range of different
perspectives making extensive use
of acquired knowledge and
understanding.
Knowledge and understanding
shown is consistently applied to
context enabling a logical and
sustained argument to develop.
Examples used enhance rather
than detract from response.
Concerted effort is made to
consider all aspects of a system /
problem or weigh up both sides to
an argument before forming an
overall conclusion. Judgements
made are based on appropriate
and concise arguments that have
been developed in response
resulting in them being both
supported and realistic.
Middle (reasonable) Awareness of the meaning of the
terms in the question. Knowledge
is sound and effectively
demonstrated. Demands of
question understood although at
times opportunities to make use of
acquired knowledge and
understanding not always taken.
Knowledge and understanding
applied to context. Whilst clear
evidence that an argument builds
and develops through response
there are times when opportunities
are missed to use an example or
relate an aspect of knowledge or
understanding to the context
provided.
There is a reasonable attempt to
reach a conclusion considering
aspects of a system / problem or
weighing up both sides of an
argument. However the impact of
the conclusion is often lessened by
a lack of supported judgements
which accompany it. This inability
to build on and develop lines of
argument as developed in the
response can detract from the
overall quality of the response.
Low (basic) Confusion and inability to
deconstruct terminology as used in
the question. Knowledge partial
and superficial. Focus on question
narrow and often one-dimensional.
Inability to apply knowledge and
understanding in any sustained
way to context resulting in tenuous
and unsupported statements being
made. Examples if used are for the
most part irrelevant and
unsubstantiated.
Little or no attempt to prioritise or
weigh up factors during course of
answer. Conclusion is often
dislocated from response and any
judgements lack substance due in
part to the basic level of argument
that has been demonstrated
throughout response.6
Assessment Objective
AO1 Demonstrate knowledge and understanding of the principles and concepts of computer science, including abstraction, logic, algorithms and data
representation.
AO1.1 Demonstrate knowledge of the principles and concepts of abstraction, logic, algorithms, data representation or other as appropriate.
AO1.2 Demonstrate understanding of the principles and concepts of abstraction, logic, algorithms, data representation or other as appropriate.
AO2 Apply knowledge and understanding of the principles and concepts of computer science including to analyse problems in computational terms.
AO2.1 Apply knowledge and understanding of the principles and concepts of computer science.
AO2.2 Analyse problems in computational terms.
AO3 Design, program and evaluate computer systems that solve problems, making reasoned judgements about these and presenting conclusions.
AO3.1 Design computer systems that solve problems.
AO3.2 Program computer systems that solve problems.
AO3.3 Evaluate computer systems that solve problems, making reasoned judgements about these and presenting conclusions.Question Answer Marks Guidance
1a
1 mark per bullet to max 3.
e.g.
• Remove unnecessary details // remove character features that are not needed
• e.g. remove the outside world
• e.g. Remove complexity from the realistic entities // Simply real-life objects
• e.g. simplify characters/animals/tents
• e.g. by representing them with specific objects/shapes
3
AO2.1
(2)
AO2.2
(1)
1bi
1 mark per bullet to max 2
e.g.
• Multiple processes being executed at the same time // appearing to happen simultaneously
• Giving processes a slice of the processor time
• Having multiple processors each carrying out a different process
2
AO1.1
(2)
1bii
1 mark per bullet to max 3
e.g:
• Game could have large number of requests to the server at a time
• … server needs to respond in reasonable time
• … having multiple processors handling the different requests would increase response
time
• Users could override each other’s changes
• … e.g. needs to handle if someone updates their circus while someone else is visiting
• …use record locking to stop edits if someone else has access to data
• Different users will have different response times
• …therefore the processor can still handle other requests
• …so that the performance for other users is not affected
3
AO2.1
(2)
AO2.2
(1)
1ci
1 mark per bullet to max 2
e.g:
• A rule of thumb / estimate / guess
• That estimates the distance / cost from each node to the destination node
• To speed up the process of finding a solution
• …by identify which paths to follow first
2
AO1.1
(1)
AO1.2
(1)8
1cii
Node Distance travelled Heuristic
Distance
travelled +
Heuristic
Previous
node
MARKING
GUIDANCE
A (✓) 0 90 90 1 MARK
B (✓) ∞ 21 80 101 A 1 MARK
C (✓) ∞ 42 65 107 A 1 MARK
D (✓) ∞ 21+38=59
42+12=54
50 109 104 B C 1 MARK
E ∞ 21+40=61 50 111 B 1 MARK
F (✓) ∞ 42+12+23=77 30 107 D 1 MARK
G ∞
42+12+23+33=110
0 110 F 1 MARK
Final path = A,C,D,F,G and Distance = 110 (1 Mark)
8
AO1.2
(3)
AO2.1
(3)
AO2.2
(2)
1d
1 mark per bullet to max 6
• Visit root node M
• Visit E and S
• Visit C and J (from E)
• …then P and V (from S)
• Visit G and K (from J)
• Visit L (from K)
6
AO1.2
(1)
AO2.1
(3)
AO2.2
(2)1e
Mark Band 3 – High level (7-9 marks)
The candidate demonstrates a thorough knowledge and understanding of data mining; the material is
generally accurate and detailed.
The candidate is able to apply their knowledge and understanding directly and consistently to the context
provided.
Evidence/examples will be explicitly relevant to the explanation.
The candidate is able to weigh up the use of data mining which results in a supported and realistic judgment
as to whether it is possible to use them in this context.
There is a well-developed line of reasoning which is clear and logically structured. The information
presented is relevant and substantiated.
Mark Band 2 – Mid level (4-6 marks)
The candidate demonstrates reasonable knowledge and understanding of data mining; the material is
generally accurate but at times underdeveloped.
The candidate is able to apply their knowledge and understanding directly to the context provided although
one or two opportunities are missed. Evidence/examples are for the most part implicitly relevant to the
explanation.
The candidate makes a reasonable attempt to come to a conclusion showing some recognition of
influencing factors that would determine whether it is possible to use data mining in this context.
There is a line of reasoning presented with some structure. The information presented is in the most part
relevant and supported by some evidence
Mark Band 1 – Low Level (1-3 marks)
The candidate demonstrates a basic knowledge of data mining with limited understanding 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 nothing more than an unsupported assertion.
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.
9
AO1.1
(2)
AO1.2
(2)
AO2.1
(2)
AO3.3
(3)
AO1: Knowledge and Understanding
Indicative content
• Data mining searches large amounts
of data
• Searches for relationships between
facts/components/events that may
not be obvious
• May include pattern matching
algorithms
• May involve anomaly detection
algorithms
• Used for business modelling
• Used to plan for future eventualities
AO2: Application
• Can look for how people use the
website e.g. visiting times, what they
click on, how long they spend on
certain features, what they do first,
which elements are used least
• Give recommendations for future
changes to the game e.g. features to
add, or remove
AO3: Evaluation
Candidates will need to evaluate the
benefits and drawbacks of using data
mining.
e.g.
• Can use to introduce new features
• Increase use from users
• Increase revenue by selling features
used more often
• Make the game more appealing
• Remove features people don’t use
• Use to target advertising
• Privacy concerns from users
• Misuse of information10
2ai
1 mark for each number/statement up to a maximum of 6 marks:
function binarySearch(dataArray:byref, upperbound, lowerbound, searchValue)
while true
middle = lowerbound + ((upperbound - lowerbound) DIV 2)
if upperbound < lowerbound then
return -1
else
if dataArray[middle] < searchValue then
lowerbound = middle + 1
elseif dataArray[middle] > searchValue then
upperbound = middle - 1
else
return middle
endif
endif
endwhile
endfunction
6
AO1.2
(2)
AO3.3
(4)
2aii Do…until // repeat…until // post condition
1
AO1.2
(1)2b
1 mark for each tick up to a maximum of 6 marks
Worst-case space complexity:
Binary
search
Linear
search
O(log(n))
O(1)
O(n)
Best-case space complexity:
Binary
search
Linear
search
O(log(n))
O(1)
O(n)
Average time complexity:
Binary
search
Linear
search
O(log(n))
O(1)
O(n)
6
AO1.1
(6)
2c
1 mark for any example
e.g.
• Data is not sorted
• Item you are looking for is the first item in the list
• Small number of items
1
AO1.2
(1)12
3a
1 mark per bullet, each must be applied correctly to data
• Choose a pivot // identify start and end pointers
• Compare each element to the pivot… // compare start and end pointers
• Put items < pivot in the left sublist
• Put items > pivot in the right sublist
• Choose a pivot in each sublist
• If start pointer is larger than end pointer…
• …then swap data items around
• And repeat the process until each item becomes a pivot
5
AO1.2
(2)
AO2.2
(3)
3b
1 mark per bullet to max 2
• decomposing data sets into smaller subsets
• and then sorting each split subset
• until each subset is sorted
• and then combining the subsets to provide a solution
2
AO1.1
(1)
AO2.1
(1)4
Mark Band 3 – High level (7-9 marks)
The candidate demonstrates a thorough knowledge and understanding of IDEs; the material is
generally accurate and detailed.
The candidate is able to apply their knowledge and understanding directly and consistently to the
context provided.
Evidence/examples will be explicitly relevant to the explanation.
The candidate is able to weigh up the use of IDEs which results in a supported and realistic
judgment as to whether it is possible to use them in this context.
There is a well-developed line of reasoning which is clear and logically structured. The information
presented is relevant and substantiated.
Mark Band 2 – Mid level (4-6 marks)
The candidate demonstrates reasonable knowledge and understanding of IDEs; the material is
generally accurate but at times underdeveloped.
The candidate is able to apply their knowledge and understanding directly to the context provided
although one or two opportunities are missed. Evidence/examples are for the most part implicitly
relevant to the explanation.
The candidate makes a reasonable attempt to come to a conclusion showing some recognition of
influencing factors that would determine whether it is possible to use IDEs in this context.
There is a line of reasoning presented with some structure. The information presented is in the
most part relevant and supported by some evidence
Mark Band 1 – Low Level (1-3 marks)
The candidate demonstrates a basic knowledge of IDEs with limited understanding 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 nothing more than an unsupported assertion.
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.
9
AO1.1
(2)
AO1.2
(2)
AO2.1
(2)
AO3.3
(3)
AO1: Knowledge and Understanding
Indicative content
e.g.
• IDE is software that includes an
editor, compiler, run-time
environment
Creating
• Autocorrect
• Autocomplete
• Pretty printing
Testing
• Breakpoints
• Stepping
• Variable watch window
AO2: Application
e.g.
• Tell you when you make a syntax
error
• Allows you to write and run the code
in one piece of software
• Suggests code so you don’t have to
remember code, or autocorrect
spelling mistakes
• Helps you trace the program so you
can see what happens when values
change without having to manually
insert print statements etc.
• Autogenerate boilerplate code.
AO3: Evaluation
Candidates will need to evaluate the
benefits and drawbacks of using IDEs.
e.g.
• Reduce errors through autocorrect
and suggestions
• Reduce time to write the program
because features help you spot
errors before running the code,
some errors will be corrected so you
don’t have to
• Write and test in one environment so
you don’t have to close and run
elsewhere, then re-open etc.14
5a To create an instance of an object from a class
1
AO2.1
(1)
5b
1 mark per bullet up to a maximum of 2 marks, e.g:
• When the child/derived/subclass class office/house takes on attributes/methods…
• … from building / parent/base/superclass/ class
2
AO1.2
(1)
AO2.2
(1)
5c
1 mark for each completed statement up to a maximum of 5 marks:
class building
private numberFloors
private width
private height
public procedure new(pFloors, pWidth, pHeight)
numberFloors = pFloors
width = pWidth
height = pHeight
endprocedure
public function getNumberFloors()
return numberFloors
endfunction
public function setNumberFloors(pFloors)
if pFloors >= 1 then
numberFloors = pFloors
return true
else
return false
endif
endfunction
endclass
5
AO2.2
(3)
AO3.2
(2)
Accept other specific
language conventions that
would correctly achieve the
same outcomes.5d
1 mark per bullet up to a maximum of 6 marks:
• Class declaration for house with inherits building
• Declaring bedrooms and bathrooms as private
• New declaration …
• … with all five parameters
• Calling super constructor // equivalent with floors, width and height set
• Setting bedrooms and bathrooms
e.g.
class house inherits building
private bedrooms, bathrooms
public procedure new(pFloors, pWidth, pHeight, pBedrooms, pBathrooms)
super.new(pFloors, pWidth, pHeight)
bedrooms = pBedrooms
bathrooms = pBathrooms
endprocedure
endclass
6
AO2.1
(1)
AO2.2
(2)
AO3.2
(3)
5e
1 mark per bullet up to a maximum of 4 marks:
• Procedure header taking parameter
• Adding parameter to array
• …at position numberBuildings
• Incrementing numberBuilding
e.g.
procedure newbuilding(pBuilding)
buildings[numberBuildings] = pBuilding
numberBuildings = numberBuildings + 1
endprocedure
4
AO2.1
(1)
AO3.2
(3)16
f
1 mark per bullet up to a maximum of 4 marks:
• Creating a new instance of house with identifier houseOne
• …with the correct parameters
• Creating a new instance of houseRoad named limeAvenue
• …sending houseOne as parameter to the constructor
e.g.
houseOne = new house(2, 8, 10, 3, 2)
limeAvenue = new houseRoad(houseOne)
4
AO2.1
(1)
AO3.2
(3)
6a
1 mark for each interval
Interval 1
• A is fetched
Interval 2
• A is decoded
• B is fetched
Interval 3
• A is executed
• B is decoded
• C is fetched
Interval 4
• B is executed
• C is decoded
D is fetched
4
AO1.2
(4)
6b
1 mark per bullet up to a maximum of 2 marks:
• Reduces/removes latency
• … CPU is not idle while waiting for next instruction
• Next instruction is fetched while current one is decoded/executed
• All parts of the processor can be used at any instance in time.
2
AO1.2
(2)7a
1 mark for the purpose and 1 mark for matching appropriate name (4 marks total), e.g:
• Pointer to the first element in the queue
• firstElement // any other meaningful name
• Pointer to the last element in the queue // Pointer to the first free element in the queue
• lastElement / any other meaningful name
4
AO1.2
(4)
Must cover purpose and
name for 2 marks for each
pointer.
7b
1 mark per bullet up to a maximum of 5 marks, e.g:
• Check if the queue is full
• … if the firstElement pointer (+1) = lastElement // length variable == queue’s capacity
• … if it is return False
• Adds element at lastElement (+1) position // Adds element at startposition+length
• … increments lastElement pointer
• If lastElement is greater than last Index // pointer becomes pointer MOD array.size
• …reset to 0
5
AO1.2
(5)
Look out for variations in
representing the queue18
8ai
1 mark per box up to a maximum of 3 marks.
• Select puzzle and display blank grid (below new game)
• Select box and change colour of boxes (below play game)
• Compare to answer and display correct/incorrect (below check answer)
e.g.
3
AO2.2
(3)
Boxes might be in 1 box, or
split down into many.
Positioning only needs to be
below those identified.
Ignore any
additional/irrelevant boxes.
8aii
1 mark per bullet up to a maximum of 2 marks, e.g:
e.g.
• Splits the problem into smaller chunks
• Smaller problems are more manageable
• Smaller problems are easier to solve
• To see where code can be reused in the solution
• To split tasks between different programmers
2
AO1.1
(1)
AO1.2
(1)
Nonogram
New Game
Select Puzzle Display blank grid
Play game
Select Box Change colour of
boxes
Check answer
Compare to
answer
Display
Correct/Incorrect8aiii
1 mark for input, 1 for process 1 for output
e.g.
Input:
• Clicking a box
Process:
• Generating new puzzle
• Checking if block is black
• Changing block to white
Output:
• Grid with coloured squares
3
AO2.2
(3)20
8bi
1 mark for each correctly completed statement up to a maximum of 5 marks:
01 function countRow(puzzle:byref, rowNum:byval)
02 count = 0
03 output = " "
04 for i = 0 To 4
05 if puzzle[rowNum, i] == 1 then
06 count = count + 1
07 elseif count >= 1 then
08 output = output + str(count) + " "
09 count = 0
10 endif
11 next i
12 if count>= 1 then
13 output=ouput+str(count)
14 elseif output == "" then
15 output = "0"
16 endif
17 return output
18 endfunction
5
AO2.2
(2)
AO3.2
(3)
Accept
for i = 0 to row.length-1
for i = 0 to row.length
for i=0 to 5
8bii
1 mark per bullet up to a maximum of 2 marks, e.g:
• Initialise the variable output…
• …with a space
• …for use later on in the code…
• …So it can be used for concatenation later in the code …
• …to avoid an error being generated
2
AO1.2
(1)
AO2.2
(1)
8biii
1 mark per bullet up to a maximum of 3 marks, e.g:
• check the value stored in each index
• check whether it is at the end of a row
• check whether each row has been given an output or not
3
AO2.2
(3)8biv
1 mark per bullet up to a maximum of 6 marks:
• Procedure heading for displayRowAnswer
• …taking puzzle as parameters
• Nested loops through all array elements
• …outputting all rows
• … at the end of each row calling countRow ….
• …..with parameters puzzle and the current loop counter
e.g.
procedure displayRowAnswer(puzzle)
for i = 0 To 4
for j = 0 To 4
print(puzzle[i, j] + " ")
next j
print (" " + countRow(puzzle, i))
next i
endprocedure
6
AO2.2
(3)
AO3.2
(3)
Accept
for i = 0 to row.length-1
for i = 0 to row.length
for i=0 to 5
8bv
1 mark for clearly identifying each error and giving the correction.
• Line 01 needs answerGrid as parameter
• Line 04 == should be !=
• Line 08 should be next row
3
AO2.1
(3)
Do not award marks for line
numbers alone without stating
the error.
Consider 1 mark for not
changing line 04 but changing
05 to true and 09 to False22
8c
Mark Band 3 – High level (7-9 marks)
The candidate demonstrates a thorough knowledge and understanding of local and global variables; the
material is generally accurate and detailed.
The candidate is able to apply their knowledge and understanding directly and consistently to the context
provided.
Evidence/examples will be explicitly relevant to the explanation.
The candidate is able to weigh up the use of both local and global variables which results in a supported
and realistic judgment as to whether it is possible to use them in this context.
There is a well-developed line of reasoning which is clear and logically structured. The information
presented is relevant and substantiated.
Mark Band 2 – Mid level (4-6 marks)
The candidate demonstrates reasonable knoledge and understanding of local and global variables; the
material is generally accurate but at times underdeveloped.
The candidate is able to apply their knowledge and understanding directly to the context provided although
one or two opportunities are missed. Evidence/examples are for the most part implicitly relevant to the
explanation.
The candidate makes a reasonable attempt to come to a conclusion showing some recognition of
influencing factors that would determine whether it is possible to use local and global variables in this
context.
There is a line of reasoning presented with some structure. The information presented is in the most part
relevant and supported by some evidence
Mark Band 1 – Low Level (1-3 marks)
The candidate demonstrates a basic knowledge of local and global variables with limited understanding
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 nothing more than an unsupported assertion.
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.
9
AO1.1
(2)
AO1.2
(2)
AO2.1
(2)
AO3.3
(3)
AO1: Knowledge and Understanding
Indicative content
Local variables:
• Scope within the module defined
within
• Cannot access externally unless
passed as parameter, or returned
from function
• When module is exited, memory of
variable is freed
Global variables:
• Scope within the entire program
• Can access from anywhere
• Retained in memory permanently
ByRef Points to location of variable
ByVal Sends the value
AO2: Application
• If global the arrays can be accessed
from all modules by direct reference
• If local to the main, the arrays will
need to be passed as parameters
byreference
• Can send ByVal – but not always
possible with arrays in some
languages
• Modules are self contained and then
can be reused in other programs he
wants to create without needing to
take the global variables with them
AO3: Evaluation
e.g.
• +ve Local = memory efficient
• +ve Global = easier programming,
simpler to follow, easier to debug
• -ve Global = memory inefficient, not
good programming technique
• -ve Local = more difficult to
trace/debug/follow where the values
are passed
• Relatively small program – don’t
know about overall plan for it, it
might not be memory intensive,
unlikely anyone else is going to
access/amend e.g. use as a library –
therefore global would not waste
significant resources8d
1 mark per bullet to max 4
e.g.
• Make use of random numbers
• Generate an x/horizontal size for the grid
• Generate a y/vertical size for the grid
• Loop through each row/column
• …generate a number between 0 and the number of rows/columns (depending on MP4
answer)
• Loop through each box
• …generate a 1 or 0 to store in it
4
AO2.1
(2)
AO2.2
(2)OCR (Oxford Cambridge and RSA Examinations)
The Triangle Building
Shaftesbury Road
Cambridge
[Show More]