Data Types Flashcards
defines a collection of data values and a set of predefined operations on those values
data type
Data types that are not defined in terms of other types are called
primitive data types
The primitive data types of most imperative languages include …
numeric, Boolean, and character types
has range of values that has only two (2) elements, one for true and one for false
Boolean data type
is used to store only a single character. Examples of characters include letters, numerical digits, common punctuation marks, and whitespace
character data type
Numeric type includes
Integer, floating-point data types, decimal data types
is the most common primitive numeric data type
integer
model real numbers, but the representations are only approximations of many real numbers.
floating-point data types
store a fixed number of decimal digits, with the decimal point at a fixed position in value
decimal data types
has values that consist of sequences of characters
character string (or string) type
The most common string operations are? (5)
assignment, concatenation, substring reference, comparison, and pattern matching
What are the three string length options? (3)
Static length string, Limited dynamic length string, Dynamic length string
The length of string values can be fixed and set when the string is created
Static length string
The length of string values can have varying length up to a declared and fixed maximum set by the variable’s definition.
Limited dynamic length string
The length of string values can have varying length with no maximum
Dynamic length string
consist of range of possible values that can be easily associated with the set of positive integers
ordinal type
Two (2) user-defined ordinal types
- Enumeration type
- Subrange type
is one in which all of the possible values, which are name constants, are provided, or enumerated, in the definition.
enumeration type
represents a subset of the values in another ordinal type
subrange type
is a container object that stores a fixed number of values of a single type
array
The individual elements of an array are reference using a … or …
subscript or index
Five (5) categories of arrays based on the binding to subscript ranges, the binding to storage, and from where the storage is allocated
- Static array
- Fixed stack-dynamic array
- Stack-dynamic array
- Fixed-heap dynamic array
- Heap-dynamic array