4.1.1 Programming Flashcards
What is an integer ?
Negative or positive whole number
What is a Real (float) ?
Positive or negative number with a decimal/ fractional part
What is a boolean ?
Data type based on logic - one of only two values, True or False.
What is a char ?
Char refers to a single character. The character can be any letter, digit, or symbol.
What is a string ?
Array of characters
What is static data ?
A type of data structure where the size and the structure is fixed at the time of its creation
What is dynamic data ?
Data that is not fixed in size.
Extra memory is fetched from the heap as it is required and pointers ‘point’ to the location of the next item in the data structure in memory.
What is a variable ?
A container held in main memory that can hold an assigned piece of data
Assign the integer 99 to the variable num
int num = 99;
What is a condition controlled iteration (indefinite iteration) ?
A set of instructions is repeated based on whether a condition evaluates as true or false.
What is a count controlled iteration (definite) ?
A set of instructions is repeated a specific number of times.
What is an infinite iteration ?
A set of instructions that repeats and never terminates.
For loop syntax
for (initialiser (int i = 0) ; condition (i >,=,<…) ; iterator (i++))
foreach : items in an array / list
foreach( datatype name in array)
console.Write(name)
While loop syntax
While ( condition is true)
{
INSTRUCTIONS
}