Untitled Deck Flashcards

1
Q

What are user-defined data types?

A

User-defined data types are defined by a programmer within a program, enabling the creation of variables associated with them.

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

What are the two types of user-defined data types?

A
  1. Non-composite: Enumerated (enum), Pointers
  2. Composite: Set, Record, Class/object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an enumerated data type?

A

An enumerated data type is defined by listing all possible values, which are specified by the programmer.

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

What is the pseudocode syntax for defining an enumerated type?

A

TYPE <identifier> = (value_1, value_2, value_3, etc.)</identifier>

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

Provide an example of an enumerated type for months.

A

TYPE TMonth = (January, February, March, April, May, June, July, August, September, October, November, December)

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

What is the significance of the order in enumerated types?

A

The order can be used in comparisons and calculations, such as determining if a day is a weekend.

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

How can values be assigned to enum members?

A

Values can be assigned by creating constants, e.g., TYPE TPoints = (Win  3, Loss  0, Draw  1).

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

What is the Python syntax for creating an enumeration?

A

from enum import Enum
class Color(Enum):
Red=1
Green=2
Blue=3

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

What is a pointer?

A

A pointer is a data type whose value refers directly to another value stored in memory, using its address.

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

What is the pseudocode syntax for defining a pointer?

A

TYPE <pointer> = ^ <Typename></Typename></pointer>

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

What is a set in programming?

A

A set is a composite data type that can store multiple data items in a single variable, following the mathematical concept of a finite set.

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

What is the pseudocode syntax for defining a set?

A

TYPE <set-identifier> = SET OF <BaseType></BaseType></set-identifier>

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

Provide an example of a set definition in pseudocode.

A

TYPE alphaLetters = SET OF CHAR
DEFINE vowel (‘a’, ‘e’, ‘i’, ‘o’, ‘u’) : alphaLetters

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

What are the characteristics of a set?

A

Sets are unordered, unchangeable, unindexed, and do not allow duplicate values.

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