Chapter 16 Data Representation Flashcards

1
Q

What is a user-defined data type?

A

A user-defined data type is a data type that derived from an existing data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name both of the user-defined data types

A
  1. Non-composite user defined data types

2. Composite user-defined data types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name the two non-composite user-defined data types

A
  1. Enumerated

2. Pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name the two composite user-defined data types

A
  1. Record

2. Set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define ‘enumerated data type’

A

A list of possible data values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define ‘pointer data type’

A

A pointer data type is used to reference a memory location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define ‘record data type’

A

A data type that contains a fixed number of components, which can be of different types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define ‘set data type’

A

A set data type allows a program to create sets and to apply the mathematical operations defined in set theory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the operations in set theory?

A
  1. Union
  2. Difference
  3. Intersection
  4. Include an element from the set
  5. Exclude an element from the set
  6. Check whether an element is in a set
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Define ‘Objects and classes’

A

An object is an instance of a class; the class specifies how instances are created and how they behave

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the advantage of a user-defined data type to an in-built one?

A

User-defined data types are less error-prone and makes a program easier to understand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the advantage of using a record data type?

A

It allows the programmer to collect together values with different data types when these form a coherent
whole

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the two defined file types?

A
  1. Text file

2. Binary file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a text file?

A

A text file stores data in the form of alphabets, digits and other special symbols by storing their ASCII values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a binary file?

A

A file designed for storing data to be used by a computer program, it stores as a sequence or a collection of bytes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a serial file?

A

A serial file contains records which have no defined order. A typical use of a serial file would
be for a bank to record transactions involving customer accounts

17
Q

What is a sequential file?

A

A sequential file has records that are ordered, it is typically used to store data for long periods of time

18
Q

What is a direct-access file?

A

Direct-access files are sometimes referred to as ‘random-access’ files, in them, the position of a record is calculated using an algorithm

19
Q

What is a real number?

A

A real number is one with a fractional part

20
Q

What is floating point representation?

A

A representation of real numbers that stores a value for the mantissa and a value for the exponent

21
Q

What is fixed point representation?

A

Fixed point representation is when an overall number of bits is chosen with a defined number of bits for the whole number part and the remainder for the fractional part

22
Q

What is a mantissa?

A

A fixed-point real number in two’s complement form and an understood position for the binary point

23
Q

What is the exponent?

A

A signed integer in two’s complement representation