CS Key Terms Flashcards
Iteration
A block of code is executed repeatedly, either until a condition is met or for a set number of times.
Statement
Any individual step/instruction in the code
Assignment
Assignment is used to set the value of a variable, e.g. x := 5; (Usually described as X becomes equal to 5). The variable is written on the left and the value on the right. Do not confuse this with the equalities operator seen below.
Serial files
Data is stored in the file in the order in which it was entered. New data is appended to the end of the file.
Sequential files
The data is sorted according to a key field. New data is inserted in the correct position.
Watches/variable checks
Outputting the value of variables at specified points in the program, or when they change.
Translator diagnostics
Messages generated by the translator when converting the code to executable code. Helpful in finding syntax errors and some logic errors. Sometimes the line the error is reported on is not accurate.
Logic error
The code as it is written does something which is different from what the programmer intended. Usually detected while testing, as the program produces an incorrect result.
String
Textual data in the form of a list of characters, for example words and punctuation. String data is made up of character data and will usually vary in length.
Sequence
Executes each statement once, in the order in which it is given.
Subroutines
A sub-program, a set of statements written to perform a given task as part of solving the main problem. It can be called using its identifier.
Function
Specifically a subroutine which returns a single value and can therefore be used as if it were a variable.
Parameter/argument
Data item being supplied to a function or procedure when it is called
Pseudo code
A method of writing an algorithm using normal language which will mimic the programming code, but without worrying about specific syntax. It is useful for planning programs or explaining them to other people.
Indentation
Every time a new line of code is placed within a programming construct, e.g. If statement, the code should be intended to show that it exists within that structure. This makes it clear where each structure starts and finishes.
Initialising variables
This means giving variables a starting value, to ensure it starts at the right value or doesn’t hold a junk value from memory. Typically 0, “” or false, although could be a more specific value depending on the program.