Composite User Defined Data Types Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

State what is meant by a composite user defined data type

A

With reference to at least one other type of data type

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

Give examples of composite user-defined data types

A

Record Data Type, Set Data Type, Objects and Classes, Arrays (same data type)

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

State what is meant by a record data type

A

A data type that contains a fixed number of components which can be of different types. (It is the most useful)

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

Write the pseudocode for a record data type.

A
TYPE
TEmployeeRecord
DECLARE FirstName: String
DECLARE LastName: String
DECLARE DOB: Date
DECLARE Salary: Currency
ENDTYPE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Write the pseudocode to access an individual data item

A

Using dot notation…

Employee1.DOB

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

State how records are normally implemented as a data structure

A

Where one or two of the variables are defined as pointer variables

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

State what is meant by Set Data Type

A

Allows a program to create sets and to apply mathematical operations defined in set theory

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

State the list of operations that are defined in Set Theory

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

State what is meant by Objects and Classes

A
In Object Oriented programming, a program defined the classes to be used (which are all user defined data types).
For each class the objects must be defined. Uses properties and methods.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain why are user defined data types necessary?

A

It will make large programs more understandable and less error-prone. Once the programmer has decided of this advantage to use a data type that is not one of the built in types, then user definition is inevitable.
You could use an integer variable for a program which is the same for all programs- however there cannot be a built-in record type because each different problem will need an individual definition of the record

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