2.2 Programming Fundamentals Flashcards
OCR GCSE Computer Science J277
Initialisation
Setting the initial value for a variable.
Variable
An identifier associated with an area of computer memory in which data is stored. The data can change during program execution.
Sequence
The order. A set of instructions that will be carried out, one after the other, in the stated order.
Constant
An identifier associated with an area of computer memory in which data is stored. The data CANNOT change during program execution.
Selection
A program control structure with a logical test, or sequence of tests, that evaluate(s) to True or False. It allows subsequent statements to be run selectively depending on the outcome of the test(s).
Condition
An expression that evaluates to True or False (such as within an ‘if’ statement)
Selection with multiple conditions
Multiple statements take the form of else if and act as additional conditions that are checked in the order in which they are written in the selection block
Expression
Combination of variables, constants, values, or operators that is evaluated to produce a result.
Loop
A sequence of instructions that is repeated. This can be a fixed number of repetitions (count-controlled loop) or the number of repetitions can be controlled by a condition (condition-controlled loop)
Integer
A whole number, such as 5. It can be positive or negative.
Integer Division / Floor Division / Quotient
A division where the quotient (result) is an integer and any remainders are discarded. The operator is often represented by the abbreviation DIV or in Python it uses the // sign.
Modulo operation
An operation that returns the remainder of a division. The modulo operator is often represented by the abbreviation MOD or in Python it uses the % sign.
Real / Float
Real is also referred to as float. Real numbers include numbers with decimal places. A real number can be positive or negative.
Boolean
The Boolean data type is based on logic and can have one of only two values, True or False
Char
Char refers to a single character. The character can be any letter, digit or symbol
String
The string data type refers to text. A string is a collection of characters and includes spaces, punctuation, numeric digits and any other symbols. The numeric digits would be handled as text characters, not integers.
Null
A null value is used to indicate ‘nothing’; the lack of any value, of any type of data.
Data Type
An attribute of a data item that determines the values that can be stored and the operations that can be carried out on that data item. Examples include string, character, integer, float (real) and Boolean.
Casting
Changing the data type of a piece of data. For example, converting a string to an integer using int()
Concatenation
Joining two or more strings together to make a new string.
Index
A number that describes the position of an item within an array. Starts at zero for the first item.
Substring
A part of a string.
Function
A named block of code that performs a task and returns one or more values.
Procedure
A named section of code that can be called (executed) to perform a specific task by using the identifier (name of the procedure) in a program statement. It does not return a value.