Edexcel GCSE Computer Science

2: Programming

Revision tools
You can print this page for a quick reference guide or you can use the tools below to create printable test sheets
2.1.1: be able to write programs in a high-level programming language
Programming
KeywordDefinition
High levela way of describing a programming language that hides some details of what the CPU and memory will do in order to make solving complex problems easier
Low levela way of describing a programming language that gives you complete control over the CPU and memory in order to get maximum speed and efficiency
Programthe implementation of an algorithm in code
2.1.2: understand the benefit of producing programs that are easy to read and be able to use techniques (comments, descriptive names (variables, constants, subprograms), indentation) to improve readability and to explain how the code works
Programming
KeywordDefinition
Commentssections of code that aren't executed but that describe how the rest of the code works
Constanta value with a name, that is set once, before the program runs. It can be used multiple times but it's value never changes
Descriptive namesidentifiers for variables, constants and subprograms that describe what they store or do
Indentationusing tabs and spaces to the left of a line of code to help show where it fits within the the structure of a program
Subprograma procedure or function: a section of code with a name that can be reused multiple times
Variablea data structure with a name, that can store a value that might change while the program runs
2.1.3: be able to differentiate between types of error in programs (logic, syntax, runtime)
Programming
KeywordDefinition
logic errora mistake by the programmer where the code runs and does what the programmer told it to do, but not what the programmer wanted it to do (e.g. add instead of subtract)
runtime erroran error that occurs when the code runs, but tries to do something impossible (e.g. divide by zero)
syntax errora mistake by the programmer where the code doesn't follow the rules of the programming language. This prevents the code from running at all (e.g. missing brackets)
2.1.4: be able to design and use test plans and test data (normal, boundary, erroneous)
Programming
KeywordDefinition
actual resultwhat the program really does when a particular part of it is tested
boundarya way of describing test data that is either the maximum or minimum acceptable value (e.g. "How old are you?": 0)
erroneousa way of describing test data that isn't able to be converted into the right data type (e.g. "How old are you?": potato)
expected resultwhat the user would expect the program to do if it worked properly when testing a particular part of the program
extremea way of describing test data that is too big or too small compared to expected input data (e.g. "How old are you?": 1024)
normala way of describing sensible input test data that you'd expect the program to be able to cope with (e.g. "How old are you?": 15)
test datathe values that are provided by the user to test a particular part of the program
test plana table that records how a program is tested (description, test data, expected result and actual result)
2.1.5: be able to interpret error messages and identify, locate and fix errors in a program
Programming
KeywordDefinition
Debugfind and fix an error in a program
Error messagedescription of that caused the program to crash or not run
Line numbertells you which part of your code caused an error to occur
Steprun each line of code one by one to help you see what causes an error to occur
2.1.6: be able to determine what value a variable will hold at a given point in a program (trace table)
Programming
KeywordDefinition
BooleanTrue or False
CharacterSingle letter, digit or punctuation mark (e.g. !)
Data typeInteger, boolean, real, character or string
Debugfind and fix an error in code
Integera whole number (e.g. 1)
RealDecimal number (also known as float) (e.g. 1.432)
Steprun just one line of code and see what happens
StringZero or more characters stored in order (e.g. "hello 123")
Trace tableshows the values stored in each variable after running each line of code in an algorithm or program
Valuethe data stored in a variable
Variabledata structure with a name. Used to store a value that can change when the program runs
2.1.7: be able to determine the strengths and weaknesses of a program and suggest improvements
Programming
KeywordDefinition
Accessibilityhow easy the program is to use for people with disabilities
Accuracyhow closely the program's output matches the correct and expected result
Memory usehow much RAM the program uses whilst running
Reliabilityhow frequently the program can solve a problem
Robustnesshow the program copes when something happens that might make it crash
Speedhow quickly a program runs
Usabilityhow easy to understand and use a program is
2.2.1: understand the structural components of a program (variable and type declarations, command sequences, selection, iteration, data structures, subprograms)
Programming
KeywordDefinition
command sequencelines of code that give instructions that will be executed in order
data structurearrays, lists and records that can store multiple values
declarationline of code that says what a variable will be called and what type of data it will store
iterationlines of code that control how many times a section of code should be repeated
selectionlines of code that work out a boolean expression to decide which lines of code to execute next
subprograma section of code (procedure or function) with a name that performs a specific task
Typeinteger, boolean, real, character or string
variabledata structure with a name. Used to store a value that can change whilst the program runs
2.2.2: be able to use sequencing, selection and iteration constructs in their programs
Programming
KeywordDefinition
Constructssequence, selection and iteration: the building blocks of all computer programs
Executerun an instruction
Instructiona line of code that can be executed
Iterationinstructions that control how many times a section of code will be executed
Selectioninstructions that make a choice that affects what is executed next
Sequencemultiple instructions that are executed in a specific order
2.3.1: understand the need for, and understand how to use, data types (integer, real, Boolean, char)
Programming
KeywordDefinition
Booleana type of data which is either True or False
Castingconverting from one data type to another
Chara single digit, letter or punctuation mark (e.g. *)
Integertype of data which is a whole number (e.g. 1)
Realtype of data which is a number that's got a decimal point (e.g. 1.432). Also known as a float
2.3.2: understand the need for, and understand how to use, data structures (records, one-dimensional arrays, two-dimensional arrays)
Programming
KeywordDefinition
1D arraya data structure that is like a list of values.
2D arraya data structure that is like a list of lists or a grid / table
Arraya data structure that stores multiple values of the same data type in a specific order
Data structurea record or array that stores multiple values
Indexthe position of a value within an array
Lengththe number of values inside an array
2.3.3: understand the need for, and how to manipulate, strings
Programming
KeywordDefinition
Castconvert from one data type to another data type (e.g. string "2" to integer 2)
Characteran individual letter, digit or punctuation mark
Concatenatejoin two strings together
Lengththe number of characters within a string
Stringdata type used to store zero or more characters (e.g. "123N")
Substringpart of a string (at the start, end or anywhere within a larger string)
2.3.4: understand the need for, and how to use, variables and constants
Programming
KeywordDefinition
Assignto set the value of a variable
Constanta data structure which stores a value that is set in code which can be used (but not changed) while the code runs. Usually has a name in CAPITAL_LETTERS
Declareto say that a variable exists (usually saying which data type it is going to store)
Identifierthe name of a variable or constant
Valuethe data stored in a variable or constant
Variablea data structure that can store a value that can change whilst the program runs. Usually has a name in snake_case_letters or camelCaseLetters.
2.3.5: understand the need for, and how to use, global and local variables when implementing subprograms
Programming
KeywordDefinition
Global variablea variable that can be accessed from any part of the code because it was declared outside any sub program
Local variablea variable that can only be accessed inside the sub program where it was declared.
Scopethe part of a program where you can access a variable or constant
Sub programa part of a program (procedure or function) that has its own scope
2.4.1: understand how to write code that accepts and responds appropriately to user input
Programming
KeywordDefinition
Inputthe data that the program accepts from the user
Responsethe output from the program that's displayed to the user.
Userthe person or people who will use the program when it's finished
2.4.2: understand the need for, and how to implement, validation
Programming
KeywordDefinition
Length checka type of validation that checks if the expected amount of data is provided
Lookup checka type of validation that checks if data matches a list of acceptable values
Presence checka type of validation that checks if any data has been provided at all
Type checka type of validation that checks if data is the expected data type
Validationchecking data to make sure that it is suitable to be processed or outputted
2.4.3: be able to write code that reads/writes from/to a text file
Programming
KeywordDefinition
Appendsaving data onto the end of an existing file
Extensionthe letters after the file name that indicates what type of data is stored in the file and which program should be used to open it
Filedata stored on a device that can be accessed with a name, path and extension
Namea description of the file
Paththe location of a file
Readloading data from a file as input into a program
Runtime errortype of error that can occur if you attempt to open a file that doesn't exist
Writesaving data to a file as output from a program
2.5.1: understand the purpose of, and how to use, arithmetic operators (add, subtract, divide, multiply, modulus, integer division)
Programming
KeywordDefinition
-subtraction operator
*multiplication operator
/division operator
+addition operator
Arithmetic Operatora symbol or symbols that performs a mathematical calculation using the data you seen next to them (e.g. + or -)
DIVinteger division (division ignoring the remainder)
MODmodulus operator (the remainder after dividing)
2.5.2: understand the purpose of, and how to use, relational operators (equal to, less than, greater than, not equal to, less than or equal to, greater than or equal to)
Programming
KeywordDefinition
<operator that checks if the first value is less than the second value
<=operator that checks if the first value is less than or equal to the second value
<>operator that checks if two values are not equal
==operator that checks if two values are equal
>operator that checks if the first value is greater than the second value
>=operator that checks if the first value is greater than or equal to the second value
Relational Operatorsymbol that compares two values
2.5.3: understand the purpose of, and how to use, logic operators (AND, OR, NOT)
Programming
KeywordDefinition
ANDa logic operator that combines two boolean inputs into a single output, which is True if both inputs are also True
Boolean expressiona question with a True / False answer
Logic OperatorSymbol or symbols that combine Boolean expressions
NOTa logic operator that inverts an input so that the output is the opposite boolean value
ORa logic operator that combines to boolean inputs into a single output, which is True if either or both inputs are True
2.6.1: understand the benefits of using subprograms and be able to write code that uses user-written and pre-existing (builtin, library) subprograms
Programming
KeywordDefinition
Abstractionhiding unnecessary detail to focus on what's important. You don't need to know the detail of how a subprogram works in order to use it.
Builtin subprograma procedure or function that can be used 'out of the box' (e.g. print() in python). This means common tasks are easy achieve with very little code
Callmake a subprogram run
Decompositionsplitting a big problem into smaller sections. Different programmers can work on separate subprograms.
Definitionthe lines of code that say exactly what a subprogram should do
Functiona subprogram that can be used more than once to calculate and return a value. It has a name which should describe what it does
Identifierthe name of a subprogram that should describe what it does in order to make code more readable
Library subprograma procedure or function that can be used if imported into your program. This saves programmers having to re-invent the wheel for every project
Procedurea subprogram that can be used more than once to do something useful. It has a name which should describe what it does
Reusesubprograms can be defined once but called many times
Subprograma section of code that has a name. It can be used more than once (e.g. procedure or function)
User-written subprograma procedure or function that you write yourself. This can be reused in the same or other projects.
2.6.2: understand the concept of passing data into and out of subprograms (procedures, functions)
Programming
KeywordDefinition
Functionsubprogram that can have parameters and always returns a value
Parameterdata that can be passed from one part of code into a subprogram
Proceduresubprogram that can have parameters but doesn't return a value
Return valuedata that is passed out of a function back to the part of code that called that function
Subprograma procedure or function (a reusable section of code with a name)
2.6.3: be able to create subprograms that use parameters
Programming
KeywordDefinition
Functiona subprogram that can receive zero or more parameters and always returns a value
Parameterdata passed into a subprogram that affects how it works. Treated as a local variable within that subprogram
Procedurea subprogram that can receive zero or more parameters but never returns a value
Subprograma named section of code that can be reused (procedure or function)