Non-Composite User defined Data Type Flashcards

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

State what is meant by a non-composite data type

A

It is a type that does not involve a reference to another type

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

Give examples of non-composite data types

A

Integer, Real, String, Char, Pointer…

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

State what is the requirement for using a built-in data type

A

It has to be given an identifier

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

State a difference between a built in data type and a user defined data type

A

User defined data types have to be defined before it is given an identifier

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

Give examples of non-composite user defined data types

A

Enumerated Data Type and Pointer Data Type

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

State what is meant by an enumerated data type

A

It defines a list of possible values

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

Write some pseudocode for enumerated data types and how variables can be declared

A
TYPE
TDirections = (North, East, South, West)
TDays = (Monday, Tuesday)
DECLARE 
Direction1: TDirections
DECLARE StartDay: TDays
Direction1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How are values defined in an enumerated data type?

A

Ordinal - order of values

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

Give an advantage of using ordinal values for enumerated data types

A

Allows for comparison statement i.e.

Weekend = TRUE IF Day > Friday

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

State what is meant by a 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
11
Q

State when a Pointer Data Type could be used

A

To construct dynamically varying data structures

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

State a rule about Pointer Data Types and how they point

A

The pointer definition has to relate to the type of the variable that is being pointed to

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

Write the pseudo code for a Pointer Data Type and declare a variable

A
TYPE
TMyPointer = ^
DECLARE: 
MyPointer: TMyPointer
ValuePointedTo
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When a pointer variable is used to access the value stored at the address pointed to - what is another name for this

A

The pointer reference is ‘deferenced’

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