Chapter 16 Data Representation Flashcards
What is a user-defined data type?
A user-defined data type is a data type that derived from an existing data type
Name both of the user-defined data types
- Non-composite user defined data types
2. Composite user-defined data types
Name the two non-composite user-defined data types
- Enumerated
2. Pointer
Name the two composite user-defined data types
- Record
2. Set
Define ‘enumerated data type’
A list of possible data values
Define ‘pointer data type’
A pointer data type is used to reference a memory location
Define ‘record data type’
A data type that contains a fixed number of components, which can be of different types
Define ‘set data type’
A set data type allows a program to create sets and to apply the mathematical operations defined in set theory
What are the operations in set theory?
- Union
- Difference
- Intersection
- Include an element from the set
- Exclude an element from the set
- Check whether an element is in a set
Define ‘Objects and classes’
An object is an instance of a class; the class specifies how instances are created and how they behave
What is the advantage of a user-defined data type to an in-built one?
User-defined data types are less error-prone and makes a program easier to understand
What is the advantage of using a record data type?
It allows the programmer to collect together values with different data types when these form a coherent
whole
What are the two defined file types?
- Text file
2. Binary file
What is a text file?
A text file stores data in the form of alphabets, digits and other special symbols by storing their ASCII values
What is a binary file?
A file designed for storing data to be used by a computer program, it stores as a sequence or a collection of bytes