Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Gcse Computer Science: J277/02: Computational Thinking, Algorithms and Programming

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

GCSE

Computer Science

J277/02: Computational thinking, algorithms and


programming

General Certificate of Secondary Education

Mark Scheme for June 2023

Oxford 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 2023

Oxford Cambridge and RSA Examinations


J277/02 Mark Scheme June 2023

MARKING INSTRUCTIONS
PREPARATION FOR MARKING
RM ASSESSOR
1. Make sure that you have accessed and completed the relevant training packages for on-screen marking: RM Assessor Assessor Online Training;
OCR Essential Guide to Marking.

2. Make sure that you have read and understood the mark scheme and the question paper for this unit. These are posted on the RM Cambridge
Assessment Support Portal http://www.rm.com/support/ca

3. Log-in to RM Assessor and mark the required number of practice responses (“scripts”) and the number of required standardisation responses.

YOU MUST MARK 5 PRACTICE AND 10 STANDARDISATION RESPONSES BEFORE YOU CAN BE APPROVED TO MARK LIVE SCRIPTS.

MARKING
1. Mark strictly to the mark scheme.

2. Marks awarded must relate directly to the marking criteria.

3. The schedule of dates is very important. It is essential that you meet the RM Assessor 50% and 100% (traditional 40% Batch 1 and 100% Batch 2)
deadlines. If you experience problems, you must contact your Team Leader (Supervisor) without delay.

4. If you are in any doubt about applying the mark scheme, consult your Team Leader by telephone or the RM Assessor messaging system, or by email.

5. Crossed Out Responses


Where a candidate has crossed out a response and provided a clear alternative then the crossed out response is not marked. Where no alternative
response has been provided, examiners may give candidates the benefit of the doubt and mark the crossed out response where legible.

Rubric Error Responses – Optional Questions


Where candidates have a choice of question across a whole paper or a whole section and have provided more answers than required, then all responses
are marked and the highest mark allowable within the rubric is given. Enter a mark for each question answered into RM assessor, which will select the
highest mark from those awarded. (The underlying assumption is that the candidate has penalised themselves by attempting more questions than
necessary in the time allowed.)
2
J277/02 Mark Scheme June 2023

Multiple Choice Question Responses


When a multiple choice question has only a single, correct response and a candidate provides two responses (even if one of these responses is correct),
then no mark should be awarded (as it is not possible to determine which was the first response selected by the candidate).
When a question requires candidates to select more than one option/multiple options, then local marking arrangements need to ensure consistency of
approach.

Contradictory Responses
When a candidate provides contradictory responses, then no mark should be awarded, even if one of the answers is correct.

Short Answer Questions (requiring only a list by way of a response, usually worth only one mark per response)
Where candidates are required to provide a set number of short answer responses then only the set number of responses should be marked. The
response space should be marked from left to right on each line and then line by line until the required number of responses have been considered. The
remaining responses should not then be marked. Examiners will have to apply judgement as to whether a ‘second response’ on a line is a development
of the ‘first response’, rather than a separate, discrete response. (The underlying assumption is that the candidate is attempting to hedge their bets
and therefore getting undue benefit rather than engaging with the question and giving the most relevant/correct responses.)

Short Answer Questions (requiring a more developed response, worth two or more marks)
If the candidates are required to provide a description of, say, three items or factors and four items or factors are provided, then mark on a similar basis
– that is downwards (as it is unlikely in this situation that a candidate will provide more than one response in each section of the response space.)

Longer Answer Questions (requiring a developed response)


Where candidates have provided two (or more) responses to a medium or high tariff question which only required a single (developed) response and
not crossed out the first response, then only the first response should be marked. Examiners will need to apply professional judgement as to whether
the second (or a subsequent) response is a ‘new start’ or simply a poorly expressed continuation of the first response.

6. Always check the pages (and additional objects if present) at the end of the response in case any answers have been continued there. If the candidate
has continued an answer there, then add a tick to confirm that the work has been seen.

7. Award No Response (NR) if:


• there is nothing written in the answer space or no valid attempt at an answer (e.g. “I don’t know”)

Award Zero ‘0’ if:


3
J277/02 Mark Scheme June 2023

• there is an attempt at an answer that is not worthy of credit (this includes text and symbols).

Team Leaders must confirm the correct use of the NR button with their markers before live marking commences and should check this when
reviewing scripts.

8. The RM Assessor comments box is used by your team leader to explain the marking of the practice responses. Please refer to these comments
when checking your practice responses. Do not use the comments box for any other reason.
If you have any questions or comments for your team leader, use the phone, the RM Assessor messaging system, or e-mail.

9. Assistant Examiners will send a brief report on the performance of candidates to their Team Leader (Supervisor) via email by the end of the marking
period. The report should contain notes on particular strengths displayed as well as common errors or weaknesses. Constructive criticism of the
question paper/mark scheme is also appreciated .

4
J277/02 Mark Scheme June 2023

10. Annotations

Annotation Meaning

Omission mark

Benefit of doubt (must be accompanied with a tick)

Cross

Follow through (must be accompanied with a tick)

Not answered question

Benefit of doubt not given

Repeat

Tick

Too vague

Blank pages, pages with no annotation, no attempt to answer the question, page seen on QER

5
J277/02 Mark Scheme June 2023

11. Subject Specific Marking Instructions

Mark scheme conventions:

• Each mark point is worth 1 mark unless stated otherwise


• Each mark point can only be awarded once
• A word/phrase that is underlined needs to be exact in the answer to award the mark point
• A word/phrase that is bold needs that concept to be in the answer (but can be given in multiple ways) to award the mark point
• 3 dots at the end of one mark point and at the start of the next mark point mean that the second mark point cannot be awarded
without the first being awarded, unless the mark scheme states otherwise (for example a reasonable attempt with some
inaccuracies)
• 3 dots at the start of a mark point, without 3 dots at the end of the mark point above, means the sentence carries on and there is no
dependency
• Any text in brackets is not required to gain the mark point
• Single / means alternative word
• Double // means an alternative statement that is acceptable for the same mark point
• Enlarged font is used for visibility reasons only

Annotating scripts:
• Blank pages at the start of the script need SEEN annotation
• Any questions answered elsewhere (e.g. on the first blank pages, separately on the page) need to be linked within RM Assessor
and annotated with ticks/crosses/SEEN as appropriate
• 1 tick for every mark awarded, if a question is given 3 marks there must be 3 ticks
• A BOD or FT annotation needs to be accompanied by a tick
• Any answers with no candidate response need a SEEN annotation and NR entered as the mark.
• Any questions where the candidate has not attempted the question e.g. answered 'don't know' need a SEEN annotation and NR
entered as the mark.
• All questions must be annotated throughout the marking process.

6
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


1 (a) 1 mark per row 4 No mark if more than 1 tick for that row.
(AO1 1b)

Statement Low- High- Allow other indications of choice (e.g. cross) as


level level long as clear.
The same language can be ✓
used on computers that
use different hardware
It allows the user to directly ✓
manipulate memory
It allows the user to write ✓
English-like words
It always needs to be ✓
translated into object code
or machine code
1 (b) total = num1 + num2 1 Allow other logically valid responses that result in
(AO3 2b)
total storing the correct value. Accept other
suitable assignment operators (e.g.  )

e.g.
total = sum(num1, num2)

total = num2 + num1

x = num1 + num2
total = x

Ignore any values given to the variable. Ignore


capitalisation and minor misspelling. Ignore
superfluous code that does not affect outcome.

7
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


1 (c) (i) print(12 ^ 2) 1 Accept ** or other sensible operator that indicates
(AO2 1a)
raising to a power.

If pseudocode operator given, must be a single


word/symbol (e.g. pow), not containing spaces.

1 (c) (ii) if number MOD 2 == 0 then 1 Accept % or other sensible operator that indicates
(AO2 1a)
modulus

If pseudocode operator given, must be a single


word/symbol (e.g. modulo), not containing spaces.

1 (c) (iii) difference = measurement1 - 1 Accept other sensible operator that indicates
measurement2 (AO2 1a)
subtraction.

If a pseudocode operator given, must be a single


word/symbol (e.g. minus), not containing spaces.

8
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


1 (d) 1 mark each: 3 Ignore lines 02 and 05 in answer unless these
(AO3
• Start is set to 3 on line 01 and 3 is output on change or output any values.
2c)
line 03.
• 2, 1 and 0 are output on next 3 iterations Candidate may repeat start value when
with start updated to 2, 1, 0, -1 on correct unchanged, this is acceptable.
line numbers.
• Finished is output on line 06
Penalise incorrect or missing line numbers or
Line start Output additional output once only then FT. This includes
01 3 where variable change and output appear on the
BP1 same line.
03 3

04 2 -1 must not be output for BP2


03 2
Penalise missing or incorrect output once only for
04 1 BP1 and FT for missing or incorrect output for BP2.
03 1 BP2
Finished may be with or without quotes. Ignore
04 0
case or minor spelling error.
03 0

04 -1 Max 2 marks if any incorrect output or changes to


start.
06 Finished BP3
Do not accept calculated values of start (e.g. 3-1)

9
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


2 (a) 1 mark each: 2 Question asks for a definition. Examples may
(AO1 1a)
Syntax error strengthen the response but are not acceptable by
• Error in the rules/grammar (of the program themselves.
language).
• Program does not (fully) run / translate / Do not allow “error/problem in the code, does not
execute / start (BOD) work / does not do what designed/intended to do”
for either, this applies to both.
Logic error
• Produces incorrect / unexpected “Error in the syntax” or “error in the logic” are NE
result/output even with examples
• Program runs/does not crash

10
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


2 (b) Line number 4 1 mark for each line number correctly identified.
(AO3 2c)
• 02 1 mark for each correction. Correction must match
Correction line number.
• for scoreCount = 0 to scores.length
- 1 If wrong line number, do not mark correction. If no
line number, mark correction only.
Line number
• 03 Do not penalise if response removes –1 from
Correction scores.length as long as it starts at 0.
• total = scores[scoreCount] + total
• total = total + scores[scoreCount]
Do not penalise potential off by 1 errors for looping
• total += scores[scoreCount]
(Python).

Do not penalise case or minor spelling errors as


long as intention is clear.

Allow description of change that would be made


(e.g. “change 1 to 0”)

First correction is fixing indexing error so element 0


is included. This could be done on line 03 e.g.
scores[scoreCount-1]. Second correction is
fixing addition of total.

If both errors fixed on line 03, full marks should be


given. e.g.
total = total + scores[scoreCount-1]

11
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


3 (a) 1 mark each 2 Do not allow answers that clearly refer storing the
(AO2 1b)
• stores/holds data/value/name/names[pos] position / index (or any other out of context data) for
• …so (value) can be changed / swapped / BP1; it is the name itself that is being stored, not the
moved / overwritten / inserted position. If unclear, allow BOD.
• …without being lost.
• will be assigned to names[pos-1] e.g. do not allow “holds the values of the index /
holds value for position of the name”.

Allow FT for subsequent points.


3 (b) 1 mark 2 Max 1 from each section, 2 marks total.
(AO2 1b
• do not know how many iterations / swaps
needed Do not allow “while names are in the wrong order”.
• do not know (at run time) how many times
the value will change positions BP4 must have reference to checking a condition /
• do not know how many times a condition- condition being met, not just having a condition.
controlled loop will need to run / execute

1 mark
• condition controlled loops run while/until a
condition is true / is false / until a condition is
met
• repeats while value in [pos-1] is larger than
value in [pos] // while (further) swap needed
• will swap value until in correct position //
will swap whilst in incorrect position

12
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


• More efficient than / does not need to iterate
as many times as count controlled / for
loop
3 (c) (i) 1 mark each for insertion and bubble sort, max 2 2 Answer must reference both bubble sort and
(AO1 1b)
insertion sort for 2 marks except if efficiency mark
Insertion sort: plus expansion given.
• inserts/moves values into correct position
• inserts value once (then in correct position) Allow reference to big O for efficiency discussion.
• stops when end of array reached // completes
in one pass through the array Only award efficiency once. Only award fewer
• moves items down the array / left iterations once
• start of array becomes sorted first
• creates a sorted array within an array // has a Do not accept “completes in one iteration” for
sorted/unsorted partition / section / list insertion sort.
• starts on 2nd value
Accept list / data / values / etc for array.
• more efficient/faster than bubble sort
• … because fewer iterations / comparisons (on
“when data more scrambled” only makes sense
average)
when discussing efficiency/speed, do not give
• … when data more scrambled
marks for saying that either can handle data that is
more scrambled (they both can sort data however it
Bubble sort :
is arranged).
• compares/swaps pairs of values
• value is repeatedly moved/swapped (until in
Do not accept “bubble/insertion sort does not” for
correct position)
2nd mark.
• repeats if a swap has been made // needs
multiple passes

13
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


• will complete a final iteration once sorted (to
check for no swaps needed)
• moves items up the array
• end of array becomes sorted first
• moves/bubbles the highest value to the top
• less efficient/slower than insertion sort (on
large sets of values)
• … more iterations / comparisons (on average)
• … when data more scrambled
3 (c) (ii) 1 mark each to max 2 2 Allow reference to both sorting / putting items into
(AO1 1b)
e.g. order for BP1.
• Both produce a sorted list / array
• Both work in place / without duplicating data / “Allows sorting of numbers and strings” meets BP1
without using divide and conquer
• Both need a temporary variable Allow answers relating to not needing additional
• Both swap values memory as BP2.
• Both use loops / iteration / repeats
• Both loops are nested / inside each other Allow “breaking into smaller lists” as divide and
• Both (may) need multiple passes conquer for BP2.
• Both use selection
If answer is a statement (e.g. “uses loops”), assume
• Both work with an array / list data structure
candidate is talking about both algorithms doing
• Both work from left to right
this.
• Both build up sorted list one item at a time
(after every pass)
• Both compare (pairs of) values
• Both (typically) less efficient / slower than
merge sort (or other sorting algorithms)
14
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


• Both inefficient / slow for larger / unsorted
lists // efficient for small / (nearly) sorted lists
• Both start by comparing first two values

4 (a) 1 mark each, max 2 if not fully correct circuit. 3 Shapes of logic gates must be correct. NOT gate
(AO3
must include circle for inversion. No other gates
2a)
• NOT B should include circle.
• AND gate with A / C as one direct input…
• …Second AND gate with other (unused) A / C AND gates must have two different inputs, NOT gate
as direct input and output of previous stage as must have one input. All gates must have one output.
other input
Correct system will always have NOT B and two
Fully correct circuit is any of : other AND gates correctly joined.
• Q = (A AND NOT B) AND C
• Q = A AND (NOT B AND C) Accept alternative systems that produce the correct
• Q = (A AND C) AND NOT B output.

See examples below : Accept (BOD) three input AND gate for BP2 and BP3
if used correctly.

OK if inputs/outputs not joined up to A/B/C/Q as long


as intention clear.

If lines cross on diagram, give BOD.

If (A AND C) AND NOT B drawn, allow NOT B as first


input for BP3.

15
J277/02 Mark Scheme June 2023

Q = (A AND NOT B) AND C A AND (NOT B AND C) (A AND C) AND NOT B

(b) 1 mark each 2 Allow A OR B // B OR A for logic gate 1


(AO2
• Logic gate 1: OR 1a)
Allow A AND B // B AND A for logic gate 2
• Logic gate 2: AND
If logic statement provided with multiple gates (e.g. A
OR B AND C) this is incorrect.

Allow use of symbols (e.g. ∨, + for OR, ∧, . for AND)

Allow correct drawing of logic gates.

16
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


5 (a) (i) 1 mark each to max 2 2 Allow answers that explain what would happen if
(AO1 1b)
not tested (e.g. “there might be bugs”)
• Check the program works (as intended)
• meets user requirements.
• gives the correct output / result
• Find / detect / check for errors / bugs
• Check the program does not crash // is
robust // executes / runs
• To try and break the program // destructive
testing
• Test for / improve usability / user experience
/ performance // check user feedback is
suitable
• Allow any errors to be fixed // make changes
/ improvements as a result of testing
• Ensure no problems / issues fixed when
released.
• Defensive design considerations /
anticipating misuse / so cannot be misused

17
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


5 (a) (ii) 1 mark for name, 1 mark for matching description 2 Allow other sensible descriptive names for testing.
(1 AO1
e.g. 1a), (1 Description must match test type.
• Final / terminal testing… AO2 1b)
• … Completed at the end of development / Must be a description and not just an example, but
before release. example may support description.
• … to test the product as a whole.
Do not accept descriptions that simply repeat type
• Iterative / incremental testing… of test without further clarification (e.g. “boundary,
• …completed during development. testing the boundary”).
• …after each module is completed.
• … test module in isolation Allow :
• Black box testing…
• Normal testing… • …testing without access / knowledge of a
• …test using data that should be accepted // system’s workings.
• …test that is expected to work / pass
• White box testing…
• Boundary / Extreme testing… • …testing with access / knowledge of
system’s workings.
• …test using data that is on the edge of
being acceptable / unacceptable.
Allow other sensible / valid types of testing.
• …test highest / lowest value

Do not accept examples of validation (e.g. type


• Invalid / Erroneous testing…
test, range check)
• …test using data that should be rejected /
is not acceptable / causes an error
“data that is not expected” is NE for
invalid/erroneous unless clarified.

18
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


5 (a) (iii) 1 mark for feature 4 Allow other sensible names for features.
(AO2 1b)
1 mark for matching description
e.g. Description must add more than is given in the
• Translator / compiler / interpreter … identification of the feature to be awarded. For
• … convert to low-level/machine code example, “keyword highlighting, highlights
• …allow program to be executed / run keywords” is 1 mark for the feature only.
• …produce executable file (only for compiler)
• …stops execution when error found If compiler and interpreter given as two distinct
(interpreter only) features, allow both (with suitable descriptions). Do
not allow translator and compiler/interpreter.
• Run-time environment / output window…
• …allows program / code to be run / Description must match feature.
executed
“finding errors” is NE for description of error
• …shows output of the program / code
reporting.
• Error reporting / diagnostics
Allow sensible references to AI where appropriate.
• … identify location/detail of errors
Sensible description of use needed.
• …suggests fixes
Allow other sensible features of an IDE (e.g. line
• Debugger …
numbering, auto indent, collapsed blocks, etc) with
• …find errors suitable description.

• Stepping … For text editor / error diagnostics / debugger, allow


• … execute/run the program line by line other sensible features listed as features in the
mark scheme as description (e.g. “text editor,
• Variable watch…

19
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


• … see the contents/data held in variables provides pretty printing”, “debugger, provides
stepping”)
• Break points …
• … will allow the program to stop at a
chosen / set position

• Text/code editor…
• …allows program code to be written /
entered / changed
• …allows errors to be fixed

• Pretty printing // keyword highlighting…


• … allows keywords / variables to be
coloured / identified

• Keyword completion // syntax suggestion…


• …suggests code/syntax when first part
entered.

20
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


5 (b) 1 mark for method, 1 mark to max 2 for each use 6 Validation must be applied to the rules of the game
e.g. (4 AO2
as given; do not accept uses related to input not
• Range check 1b) , ( 2 asked for (e.g. names, passwords, etc).
• … checks upper/max / lower/min / AO1 1a)

boundaries Do not accept uses that simply repeat the name of


• … make sure the players answer / input is the check (e.g. “range check, checks a range of
between sensible limits (e.g. 20 or less, numbers”)
between 2 and 20 inclusive) // not negative
• …by example of program code For range check, values must be sensible (e.g. 1 to
50), and allow input of 2 to 20. Do not allow 1 / 10
• Type check (answer could be over this).
• … making sure the data inputted is of the
correct data type For length check, must be clear that the string
• … make sure answer / input is an integer version of the data input is being checked to award
(or equivalent e.g. whole number) use marks (e.g. characters not digits).

Accept alternative names or descriptions (e.g.


• Presence check
existence check, boundary check) but name of
• … making sure a value is inputted / not
check must be sensible.
blank
• … reference to answer / input
Mark each answer as a whole, ignore method/use
• …by example of program code
headings.

• Length check
Do not accept defensive design elements (e.g.
• … limit number of characters // check input sanitisation, authentication)
maximum / minimum string length
• … answer / input must be 1 or 2
characters
21
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


• …by example of program code Examples of program code can be actual code
(e.g. if inp>=2 and inp<=20) or identification
• Format check of technique (e.g. “use IF statement / Case
• … making sure the data inputted follows a statement to limit values to between 1 and 20”). Do
set pattern not accept code just showing casting.
• … checking answer / input consists of only
1 or 2 numeric digits
• …by example of program code

• Look up / table check


• … making sure the data inputted is one from
an allowed set of values
• … checking that answer / input is one of [2,
3…20] inclusive
• …by example of program code

22
J277/02 Mark Scheme June 2023

Question Answer Mark Guidance


5 (c) 1 mark each to max 6 6 No need to cast data to string/integer.
(AO3 2b)

• Initialise / declare score (to zero) before If random numbers chosen, BP3 must use these. If
no random numbers chosen, allow manually
use, outside of any loop
setting values
• Generates 2 random numbers between 1
and 10 BP6 can be awarded for either a loop repeating 3
• Inputs answer from user displaying suitable times or the same code written out 3 times
numbers
• Checks if input is correct answer… BP5 can be given FT if sensible attempt at BP4
• … if correct adds 1 to score Do not award BP6 if same numbers used for every
• Repeats BP2 to 5 three times (for bullet question. Must pick new values each time.
points attempted)
• Outputs score after reasonable attempt at Do not penalise potential off by 1 errors for looping
(Python) or random number generation
counting
Example answer

score = 0
for count = 1 to 3
num1 = random(1, 10)
num2 = random(1, 10)
ans = input("What is” +num1 + " + " +
num2 + "?")
if ans = num1 + num2 then
score = score + 1
end if
next count
print("You scored " + score)

23
J277/02 Mark Scheme June 2023

Section B

6 (a) 1 mark for each row 4 No mark if more than 1 tick on a row.
(AO3 2a)

Variable Boolean Char String Integer Real Allow other indications of choice (e.g. cross) as
UserName ✓ long as clear.
EmergencyPhone ✓
DoorSensor ✓
DoorTime ✓

6 (b) 1 mark each: 4 Selection could be done using IF statement, case


(AO3 2b)
• Attempt at using selection / condition controlled loop statement or any other sensible valid method.
• Checking if system armed // while system armed
• If Door Sensor active OR Window Sensor active (both Allow reference to AlarmActivated or
checks required) equivalent instead of SystemArmed
• calling SoundAlarm correctly
Ignore any inputs or modification of variables.

Allow True / False as strings. Allow checking


against strings (e.g. if SystemArmed ==
“active”)

Allow checking armed/disarmed for BP2 and BP3

Only award BP4 if SoundAlarm correctly called /


not called in every situation. If issues on previous
lines (e.g. lack of brackets where needed) means
this is not the case, do not award BP4.

24
J277/02 Mark Scheme June 2023

Checking could be done by evaluating variable


directly (if SystemArmed) or by comparison
(if SystemArmed == True)

Example answer 1

if SystemArmed then
if DoorSensorActive then
SoundAlarm()
else if WindowSensorActive then
SoundAlarm()
endif
endif

Example answer 2

while SystemArmed then


if DoorSensorActive then
SoundAlarm()
else if WindowSensorActive then
SoundAlarm()
endif
endif

Example answer 3

if SystemArmed and (DoorSensorArmed


or WindowSensor) then
25
J277/02 Mark Scheme June 2023

SoundAlarm()
endif

Note – above example needs brackets,

if SystemArmed and DoorSensorArmed


or WindowSensor then

is not logically valid for this scenario (will sound


alarm when not armed if window sensor is active)

Example answer 4

if SystemArmed and DoorSensorArmed


SoundAlarm()
else if SystemArmed and WindowSensorArmed
SoundAlarm()
endif
6 (c) (i) 1 mark for 1
(AO3 1)
• Line 04

6 (c) (ii) 1 mark from 1 Do not penalise case, spacing or minor


(AO3 1)
• sensorType misspellings.
• sensorNumber
• sensorID
6 (c) (iii) 1 mark for 1 Ignore minor misspelling.
(AO3 1)
• Boolean
Accept Bool.

26
J277/02 Mark Scheme June 2023

6 (c) (iv) 1 mark from 1


(AO3 1)
• Line 01
• Line 02
• Line 03
• Line 05

6 (c) (v) 1 mark each 2 Ignore minor spelling errors / differences


(AO3 1)
• Selection
• Sequence Do not accept examples (e.g. IF)
6 (d) 1 mark each 3 Max 2 if out of order or anything extra that affects
(AO3 2c)
• SELECT SensorID // SELECT * the output.
• FROM events
• WHERE Length > 20 AND sensorType = “Door” BP1 can select multiple fields as long as
// SensorID is included.
WHERE sensorType = “Door” AND Length > 20
Ignore case. Only penalise spaces if obvious.
Field names must be correct.

“door” must be in quotation marks for BP3. Allow


quotation marks for field names and table name

BP3 can use == or = for equivalence.

Allow alternative WHERE clauses that are


logically correct (e.g. WHERE length >=21)

27
J277/02 Mark Scheme June 2023

6 (e) 1 mark each 6 Must be clear that answer is a procedure


(AO3 2b)
• Define procedure SaveLogs… definition, do not credit calling procedure for BP1.
• …with two valid parameters Allow function definition.
• Open file (for write/append) …
• … using the file name passed in as parameter If parameters are later overwritten, do not credit
• Write data to file… BP2 but FT for BP4 and 6.
• …using the data passed in as parameter
• Close file Closing text file does not need reference to file
name/object – e.g. “close file” is enough.
However, if given reference must be correct.

If code given outside of procedure, do not give


BP4 and BP6

Allow FT for multiple occurrences of same


mistake (e.g. not using filename correctly for
open and close)

Example answer

procedure SaveLogs(data, filename)


logFile = open(filename)
logFile.writeLine(data)
logFile.close()
endprocedure
6 (f) (i) 1 mark for: 1 Accept type casting Do not accept conversion.
(AO3 2a)
• Casting / cast Do not accept examples of casting.

28
J277/02 Mark Scheme June 2023

6 (f) (ii) 1 mark each to max 6 6 BP2 can be achieved either by iteration
(AO3 2b)
accessing each event or manually repeating code
• Input date and store in variable / use directly to access each event. Must be 0 to 6, not 1 to 7.
• Access all seven (indexes 0 to 6) events in array
// loop for each event in array Allow reference to events (table given) or
• Attempt at selection… arrayEvents (2D array) in answer as long as
• …to compare date input against date in array used consistently.
(element 0)
• …adding length (element 3) from array to the total if BP2 loop allow off by one errors (Python),
dates match. looping to array length or array length – 1. Allow
• Outputting calculated total and date in appropriate for each item in array or any other suitable
message(s) at the end loop.

BP4 and BP5 allow array reference as either


column major or row major.

Output can either be once at the end or on every


iteration, as long as it is output at the end.

Only give output mark if attempt made to


calculate total within the algorithm.

Do not penalise capitalisation or minor


misspellings of variable names.

29
J277/02 Mark Scheme June 2023

Example answer 1

total = 0
date = input("Please enter date")
for count = 0 to events.length-1
if events[0, count] == date then
total = total + events[3,count]
endif
next count
print("There were " + total + "
events on " + date)

Example answer 2

total = 0
date = input("Please enter date")
for item in events:
if item[0] == date then
total = total + item[3]
endif
next count
print("There were " + total + "
events on " + date)

30
Need to get in touch?

If you ever have any questions about OCR qualifications or services (including administration, logistics and teaching) please feel free to get in
touch with our customer support centre.

Call us on

01223 553998

Alternatively, you can email us on

support@ocr.org.uk

For more information visit

ocr.org.uk/qualifications/resource-finder

ocr.org.uk

Twitter/ocrexams

/ocrexams

/company/ocr

/ocrexams

OCR is part of Cambridge University Press & Assessment, a department of the University of Cambridge.

For staff training purposes and as part of our quality assurance programme your call may be recorded or monitored. © OCR
2023 Oxford Cambridge and RSA Examinations is a Company Limited by Guarantee. Registered in England. Registered office
The Triangle Building, Shaftesbury Road, Cambridge, CB2 8EA.

Registered company number 3484466. OCR is an exempt charity.

OCR operates academic and vocational qualifications regulated by Ofqual, Qualifications Wales and CCEA as listed in their
qualifications registers including A Levels, GCSEs, Cambridge Technicals and Cambridge Nationals.

OCR provides resources to help you deliver our qualifications. These resources do not represent any particular teaching method
we expect you to use. We update our resources regularly and aim to make sure content is accurate but please check the OCR
website so that you have the most up-to-date version. OCR cannot be held responsible for any errors or omissions in these
resources.

Though we make every effort to check our resources, there may be contradictions between published support and the
specification, so it is important that you always use information in the latest specification. We indicate any specification changes
within the document itself, change the version number and provide a summary of the changes. If you do notice a discrepancy
between the specification and a resource, please contact us.

Whether you already offer OCR qualifications, are new to OCR or are thinking about switching, you can request more
information using our Expression of Interest form.

Please get in touch if you want to discuss the accessibility of resources we offer to support you in delivering our qualifications.

You might also like