Fundamentals of programming Flashcards
Paper 1
What is a data type?
A data type is defined by the values it can take or the operations which can be performed on it.
What is an integer?
A whole number, positive or negative, including zero.
What is a Real/Float?
A positive or negative number which can have a fractional part.
What is a Boolean?
A value that is either true or false.
What is a charater?
A single letter number or symbol
What is a string?
A collection of characters
What are pointers?
Ways of storing references.
Define Records.
A collection of fields, each of which could have a different data type.
What are arrays?
A finite, indexed set of related elements each of which has the same data type.
What are user defined data types
User-defined data types are derived from existing data types in order to create a customised data structure.
What is variale declaration?
This is when you create a variable giving it a name, sometimes giving it a data type.
What is constant declaration?
This is the same as variable declaration but when declared, it doesn’t change while the program is running.
What is assignment?
This is when you give a constant or variable a value.
What is iteraton?
This is when an instruction is repeated over a certain period of time.
What is selection?
This is when values are compared and an action is taken based on those values.
Define Subroutine
It is defined as a block of code containing set of instructions.
What are relational Operations
- Equal to → =
- Not equal to → <> or !=
- Less than → <
- Greater than → >
- Less than or equal to → <=
- Greater than or equal to → >=
What are local variables?
A local variable is a variable that can only be accessed from the subroutine within which it is declared.
What are global variables?
Global variables can be accessed from any part of a program and exist in memory for the entire duration of the program’s execution.
What is a recursive subroutine?
A recursive subroutine is a subroutine that calls on itself.
What is a class?
A class is a blueprint for an object.
What is an object?
They are instances of classes.