1/21
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Sequence
A code construct where instructions follow, one after the other
Selection
A code construct where the code makes a decision, and takes one of several branches. An example is shown here in OCR Exam Reference Language (ERL).
Iteration
A code construct where the instructions repeat. Can be count-controlled or condition-controlled. An example is shown here in OCR Exam Reference Language (ERL).
Code construct
A building block of code, they are sequence, selection and iteration
Count-controlled
The type of iteration that repeats instructions a set number of times, using a count. Uses a for loop in most high-level languages
Condition-controlled
The type of iteration that repeats instructions a until a condition is met. Uses while or repeat in high-level languages
Subprogram
A small set of instructions that completes a specific task, sometimes called a subroutine. It can be a function or procedure. The image is the flowchart shape for it
Procedure
A subprogram which does not return a value. For example it might redraw the screen or write a record to a file
Function
A subprogram which returns a value. It might return a random dice roll, calculate a ticket price or determine your exam grade
Structured code
Code that is written in a systematic way, in reasonable code blocks and using subprograms. Makes code easier to maintain
Random
Describes an arbitrary number generated by a high-level language, useful in games and simulation programs
Variable
A named memory location holding a single value that can change during the program, e.g. name, age, x, y
Constant
It cannot change, this is a named memory location for something that stays the same. Examples are PI, Number_of_Levels, MAXHEALTH
Operator
Any symbol or keyword that performs a calculation on its values, they can be arithmetic, comparison or boolean
Arithmetic operator
A symbol used in an expression to perform arithmetic calculations, these are + - * / DIV MOD and ^
Comparison operator
A symbol used to compare two values in an expression, they are == != < <= > >=
Boolean operator
A keyword that carries out a logic operation, it can be AND, OR or NOT
Input
Any data that is received into a program while it is running
Output
Information that is produced by a program and made available for us to see or hear
Expression
A phrase made up of at least one operation plus literals, constants or variables, it can be evaluated and produce a result. Valid examples are
total / 7
age >= 18
time < 8 AND band=="Senior"
Literal
An actual value coded into the program, not a variable or constant. Examples in bold are:
MaxLives = 10
Level = "Haunted Castle"
if health < 5 then
Assignment
A statement that assigns a value to a variable. The right side of the equals sign can be any expression. These are valid:
health = 100
fare = 5 + 0.5 * miles
discount = time < 8 AND band=="Senior"