Data Types Flashcards
What are data types used to describe?
They describe the type of data a variable contains in a computer program
What is an Integer data type?
A positive or negative whole number
What is a Real/Float data type?
A number that contains a decimal point
What is a Boolean data type?
Can represent two logical states “True” or “False”
What is a Character data type?
Represents a single alphanumeric data item
What is a String data type?
one or more characters
What is a Date/time data type?
Contains details of an instant in time
What is a Pointer/reference data type?
A data object that contains the memory location of another variable. A form of indirect addressing
What is a records data type?
Made up of a list of elements which can contain a group of fixed length fields of different data types
What is an arrays data type?
Made up of a list of data elements that are the same data type and size. Can be one or more dimensional
What is a built in data type?
Give some examples
A data type that the programming language offers built in support.
Integer, Byte, Boolean, Real, Character, Strings
What are user defined data types?
A data type declared by the user to meet their specific requirements
What are variables?
Variables are used to store data that may change when the program is executed
What are Constants and how are they represented?
Constants are used to store data that does not change. They are declared in all capital letters.
What is assignment?
Assignment is where a value is computed within a program and assigned to a variable
What is a subroutine?
A set of instructions that perform a certain task. It can be stored once and called many times within a program
What is a procedure?
A subroutine that is called to perform a task. It doesn’t return a value
What is a function?
A subroutine that contains a series of instructions. When called it executes the instructions and returns a value
What is iteration?
Where a program repeatedly executes a section of code whilst a logical condition is satisfied.
What is definite iteration?
Where the number of iterations that take place is known before the start of execution.
What is indefinite iteration?
Where the number of iterations that take place are unknown before the start of the loop but is determined by a logical condition.
When is a for loop used?
Used in definite iteration, when the same instruction/calculations are carried out for a known number of iterations
When is a while used?
Used in definite iteration, when a condition is satisfied at the start of a loop and stops when it’s no longer true.
When is a repeat until loop used?
Used in indefinite iteration, it repeats until the condition is no longer true
What are identifiers?
Identifiers are symbolic names used for any variable, function or data definition.
What is selection?
Selection is where different lines of code are carried out depending on the result of a comparison.
When are IF-THEN statements used?
Used to execute one block of code when a boolean condition is true. No other branching when the condition is false.
When are IF-THEN-ELSE statements used?
Executes one block of code when a boolean condition is true and an alternative block of code when the condition is false.
When are nested IF-THEN-ELSE statements used?
Used if there is more than one expression to be tested. Selection inside selection.
When are CASE statements used?
Used to create several IF-THEN-ELSE statements in a row.
i.e. if, elif, elif, else
What is a list data type?
It’s an abstract data type consisting of a number of elements in which the same item can appear more than once
What can a list data type be used for?
It can be used to implement other non-built in data structures such as stacks, queues and trees