Programming Paradigms Flashcards
What is branching?
This is an instruction in a program that can cause a computer to begin executing a different instruction sequence, executing instructions in the order that is right.
What is a language-defined data type?
Also known as a built-in data type, these are data types that are included with the language that you are using to write code.
Alphanumeric Strings?
A string that contains both letters and numbers, and sometimes also special characters.
Boolean?
A result that can only have one of two possible values: true or false.
Characters?
A unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol.
Floating Point (Real)?
A function or reusable code in the python programming language that converts values into floating point numbers.
Integers?
A sequence of digits optionally prefixed with + or -. Also only whole numbers.
Strings?
A string data type used in programming, that is used to represent text rather than numbers.
What is a user-defined data type?
The opposite of built-in data types is user-defined data types.
Of which these data types have to be defined by the user.
Array?
A data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key.
Objects?
An object is a data structure or abstract data type containing fields (state variables containing data) and methods (subroutines or procedures defining the object’s behavior in code).
Records?
A record is a programmer-defined data type.
Sets?
A mutable collection of distinct (unique) immutable values that are unordered.
Different types of variables?
- Local variables
- Global variables
Difference between variables and constants?
A constant is a named data item with a predefined value, while a variable is a named data item whose value can change during program execution.
What is a local variable?
A local variable is declared within one specific sub-program of a larger main program.
What is a global variable?
A variable with global scope, meaning that it is visible (hence accessible) throughout the program, unless shadowed.
What is an Arithmetic Function?
Arithmetic functions deal with numbers. Below are three common arithmetic built-in functions that you will be expected to know for your exam.
What is a random number generator?
A built-in function, given a minimum and maximum range, it will produce a new random number when the function is called.
What are string-handling functions?
- Length ()
- Position ()
- Concatenate ()
What is a FOR loop?
A loop that will run a set amount of times based on the values it is given upon installation.
What is a WHILE loop?
A loop where the syntax begins with a condition being evaluated which will become the limit of the loops run cycle.
What is a REPEAT loop?
Also known as the DO UNTIL loop, this iterative technique uses the same structure as a WHILE loop except that the condition is evaluated at the end of the block.
What is a BREAK?
If using a FOR loop to iterate a process and you are using a conditional statement, then it may also be useful to be able to break the loop if the condition is met.
What is a subroutine?
These are blocks of code which are independent of anything external to them; they can have their own variables, and they can be passed data using arguments to perform a task or even return a value.
What is a function and procedure?
Function - A subroutine, separated from the main program, that returns a value.
Procedure - A subroutine, separated from main program that does not return a value.
What is a sequence control structure?
The order of a set of instructions in the correct order.
What is a conditional control structure?
Statements such as IF statements, which select a function based on what condition is met.
What is an iterative control structure?
A statement or block of code that is executed until the program reaches a certain result. Such as LOOPs.
What are blocks?
Procedure which are discrete blocks of code that carry out a single task.
What is a statement?
A single instruction that performs a specific and small task.