2022 P2 MS
2022 P2 MS
June 2022
Edexcel and BTEC qualifications are awarded by Pearson, the UK’s largest awarding body.
We provide a wide range of qualifications including academic, vocational, occupational
and specific programmes for employers. For further information visit our qualifications
websites at www.edexcel.com or www.btec.co.uk. Alternatively, you can get in touch with
us using the details on our contact us page at www.edexcel.com/contactus.
Pearson aspires to be the world’s leading learning company. Our aim is to help everyone progress
in their lives through education. We believe in every kind of learning, for all kinds of people,
wherever they are in the world. We’ve been involved in education for over 150 years, and by
working across 70 countries, in 100 languages, we have built an international reputation for our
commitment to high standards and raising achievement through innovation in education. Find out
more about how we can help you and your students at: www.pearson.com/uk
June 2022
Publications Code 1CP2_02_rms_20220825
All the material in this publication is copyright
© Pearson Education Ltd 2022
General Marking Guidance
0 1 2 3 Max.
Functionality (when the code Functionality (when the code Functionality (when the code 3
is run) is run) is run)
• The component parts of the • The component parts of the • The component parts of the
program are incorrect or program are complete, providing a program are complete, providing a
No rewardable material
incomplete, providing a program of functional program that meets functional program that fully meets
limited functionality that meets most of the stated requirements. the given requirements.
some of the given requirements. • Program outputs are mostly • Program outputs are accurate,
• Program outputs are of limited accurate and informative. informative, and suitable for the
accuracy and/or provide limited • Program responds predictably to user.
information. most of the anticipated input. • Program responds predictably to
• Program responds predictably to • Solution may not be robust within anticipated input.
some of the anticipated input. the constraints of the problem. • Solution is robust within the
• Solution is not robust and may constraints of the problem.
crash on anticipated or provided
input.
Question MP Appx. Answer Additional guidance Mark
number Line
4 Award marks as shown. • Award sequence only.
• Ignore intervening lines.
• Ignore changes made to
provided lines.
• Do not award same
sequence in supplied file, if
no lines are moved in that
subsection
Subprogram • If no lines are moved, not
changing the sequence, then
award no marks in this
subsection
4.1 13 Initialisation of variables before calculations inside the subprogram, all
4.2 together (One mark for any two, up to a maximum of 2)
multiplier, total, digit, value (2)
4.3 18 Iteration (for loop) placed at highest level inside subprogram, after
initialisation of local variables (1)
Order of calculations maintained: • Order of lines must be digit,
4.4 19 followed by value, followed
digit must be the first of the sequence (1)
by total.
4.5 20 value (1)
• Multiplier must be after
4.6 21 total (1) value.
4.7 22 multiplier (1)
4.8 24 Return statement is last line in subprogram (1)
Main Program • If no lines are moved, not
changing the sequence, then
award no marks in this
subsection
4.9 31 User input accepted as first operation in main program (1)
4.10 32 Repetition (while loop) after any input (1) (15)
4.11 33 Call to ‘binaryLoop’ subprogram inside repetition (while loop) (1)
4.12 34 Output of result follows call to subprogram (1)
4.13 35 User input accepted as last operation in main program, inside loop (1)
Additional
4.14 Functions for any sequence of 1s and 0s and exits on empty string (1) • Execute with test data given
in question paper
4.15 Adherence to accurate indentation (1)
Question MP Appx. Answer Additional guidance Mark
number Line
5 Award marks as shown.
Preparation
5.1 File opened for writing only (1)
5.2 Constant used as file name to open (1)
Processing all items in array
5.3 A loop to process every item in the given data • for or while
structure (1)
Controlling width of data output to file
5.4 Mechanism for controlling seven items (1) • if or for
5.5 Constant used to compare against count for column
control (1)
Formatting of output line
5.6 Line feed added to each line of output (1)
5.7 Comma added to each output item, except the last on
each line (1)
Exiting
5.8 File closed before exiting program (1) • Award if using ‘with open’
Additional
5.9 Use of techniques to ensure code is readable (1)
Levels-based mark scheme to a maximum of 6, from:
5.10 Solution design (3) Considerations for levels-based mark scheme:
5.11 • [6.1.2] Translates without error, even if
5.12 reduced functionality
0 1 2 3 Max.
• There has been little attempt to • There has been some attempt to • The problem has been decomposed 3
decompose the problem. decompose the problem. clearly into component parts.
• Some of the component parts of • Most of the component parts of the • The component parts of the
the problem can be seen in the problem can be seen in the problem can be seen clearly in the
No rewardable material
0 1 2 3 Max.
Functionality (when the code Functionality (when the code Functionality (when the code 3
is run) is run) is run)
• The component parts of the • The component parts of the • The component parts of the
program are incorrect or program are complete, providing a program are complete, providing a
No rewardable material
incomplete, providing a program of functional program that meets functional program that fully meets
limited functionality that meets most of the stated requirements. the given requirements.
some of the given requirements. • Program outputs are mostly • Program outputs are accurate,
• Program outputs are of limited accurate and informative. informative, and suitable for the
accuracy and/or provide limited • Program responds predictably to user.
information. most of the anticipated input. • Program responds predictably to
• Program responds predictably to • Solution may not be robust within anticipated input.
some of the anticipated input. the constraints of the problem. • Solution is robust within the
• Solution is not robust and may constraints of the problem.
crash on anticipated or provided
input.
Question MP Appx. Answer Additional guidance Mark
number Line
6 Award marks as shown.
Input
6.1 Convert input string to uppercase to match data given in data • <string>.upper()
structure (1)
Linear search and terminating conditions
6.2 Linear search uses length of list for upper boundary of loop (1)
6.3 Mechanisms to identify when item is found in the list (1) • Boolean variables
• Appropriate ordering of if/elif/else
6.4 Mechanism to identify when item location is passed over in • Boolean variables
• Appropriate ordering of if/elif/else
search (1)
Identifying suggested word
6.5 A method for tracking the suggested word is used (1) • index, whole record
6.6 Use of two-dimensional indexing (1)
Levels-based mark scheme to a maximum of 9, from:
6.7 Solution design (3) Considerations for levels-based mark
6.8
scheme:
6.9
6.10 • [6.1.1] Use decomposition to solve
Good programming practices (3)
6.11 problem and create solution
6.12
• [6.2.2] Use of ‘while’ loop to
6.13 Functionality (3)
6.14 traverse data structure, rather than
6.15 a ‘for’ loop
• [6.3.1] Choice of variable data
types to hold suggested word is
appropriate, i.e. a list rather than a
string and an integer
• [6.1.2] Write in a high-level (15)
language
• [6.1.4] Program code is laid out in
clear sections; white space is used
to show different parts of the
solution/functionality
• [6.1.4] Variable names are
meaningful; comments are provided
and are helpful in explaining logic
• [6.4.1] Printed outputs are fit for
purpose
• [6.1.6] Functions correctly for all
anticipated inputs in the constraints
of the problem definition
• [6.1.6] Functions correctly if a word
greater than “ZA” is entered
(special case)
Test Data:
0 1 2 3 Max.
• There has been little attempt to • There has been some attempt to • The problem has been decomposed 3
decompose the problem. decompose the problem. clearly into component parts.
• Some of the component parts of • Most of the component parts of the • The component parts of the
the problem can be seen in the problem can be seen in the problem can be seen clearly in the
No rewardable material
0 1 2 3 Max.
• There has been little attempt to lay • There has been some attempt to • Layout of code is effective in 3
out the code into identifiable lay out the code to aid readability, separating sections, e.g. putting all
sections to aid readability. although sections may still be variables together, putting all
No rewardable material
0 1 2 3 Max.
Functionality (when the code Functionality (when the code Functionality (when the code 3
is run) is run) is run)
• The component parts of the • The component parts of the • The component parts of the
program are incorrect or program are complete, providing a program are complete, providing a
No rewardable material
incomplete, providing a program of functional program that meets functional program that fully meets
limited functionality that meets most of the stated requirements. the given requirements.
some of the given requirements. • Program outputs are mostly • Program outputs are accurate,
• Program outputs are of limited accurate and informative. informative, and suitable for the
accuracy and/or provide limited • Program responds predictably to user.
information. most of the anticipated input. • Program responds predictably to
• Program responds predictably to • Solution may not be robust within anticipated input.
some of the anticipated input. the constraints of the problem. • Solution is robust within the
• Solution is not robust and may constraints of the problem.
crash on anticipated or provided
input.