CH16 Flashcards

(12 cards)

1
Q

describe the purpose of a user-defined data type (2)

A

it allows programmers to create new data types from existing data types and helps to extend the flexibility of the programming language

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

explain the reason why binary numbers are stored in normalized form (3)

A
  1. to store the maximum range of numbers in the minimum number of bytes

2.enables very large numbers to stored with accuracy

3.avoids the possibility of many numbers having multiple representations

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

explain what is meant by a user-defined composite data type. Include an example (3)

A

its a data type that is constructed by a programmer and references at least one other data type, the data types can be primitive or user defined. E.g: A class

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

explain why certain properties are set to private in programs (2)

A
  • to ensure they’re hidden
  • to ensure that attributes can only be accessed by the Class’s own methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is meant by an enumerated data type

A

a user-defined non composite data type with an ordered list of possible values

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

what is meant by the term pointer data type

A

a user-defined non composite data type that’s used to reference a memory location

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

state when underflow occurs in a binary floating-point system (2)

A

when following a logical operation and the result is too small to be precisely represented in the available system

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

explain why a binary representation is sometimes only an approximation to the real number it represents (3)

A

1- real numbers can have a fractional part such as 1/2
2-the fixed length of storage means that you can’t store very large numbers
3- binary numbers represent numbers based on the powers of 2 with limited fractional representations such as 1/2, 1/4, 1/8

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

describe what is meant by a composite data type (2)

A

a user-defined data type that is a collection of data that can consist of multiple elements of different data types

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

describe what is meant by non-composite data type (2)

A

I can be defined without referencing another data type, it can be a user defined data type

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

outline what is meant by the term collision (2)

A

a collision is when 2 values pass through a hashing algorithm and result in the same hash value, this is an issues because 2 records cannot occupy the same address

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

explain how a collision can be dealt with when writing records to a random file (3)

A

1- a process of collision resolution is used
2- start at the original hashed storage space
3- go through the following spaces in a linear fashion

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