Lesson 11.1: Data Type 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

40 Terms

1
New cards

Data type

defines a collection of data values and a set of predefined operations on those values

2
New cards

Data type

used to easily represent information related to real-world problems

3
New cards

Better error detection

why do we have data types? (1)

4
New cards

Better documentation

why do we have data types? (2)

5
New cards

Primitive Data Types

data types that are not defined in terms of other types

6
New cards

Numeric Types

data types that represent numbers

7
New cards

Integer

represent mathematical integers

8
New cards

2^ (n-1) -1

base of integers, signed or unsigned

9
New cards

Integer

can be implemented using signed-magnitude notation, one’s complement and two’s complement

10
New cards

Floating Point

models real numbers, but most representations are only approximations

11
New cards

Float

standard size; used for single-precision values

12
New cards

Double

twice as long as float types; used for double-precision values

13
New cards

Complex

used to represent complex numbers

14
New cards

Decimal

stores a fixed number of decimal digits, with the decimal point at a fixed position in the value

15
New cards

BCD

each decimal digit is represented by a fixed number of bits

16
New cards

Binary Coded Decimal

meaning of BCD

17
New cards

Boolean Types

value is either true or false

18
New cards

Boolean Types

usually used as flags; makes code more readable

19
New cards

Smallest Efficiently

they are stored in the _ _ accessible cell of memory

20
New cards

Character Type

represents a single character; they are stored in computers as numeric encodings

21
New cards

Character String Types

aka strings; data types whose values consist of sequence of characters

22
New cards

Implementation

implementing strings as a primitive type increases the writability of a language

23
New cards

String length

should _ _ be static or dynamic?

24
New cards

Static Length

string length is fixed once created

25
New cards

Limited Dynamic Length Strings

string length may be within a certain limit assigned during declaration

26
New cards

Dynamic Length Strings

string length may change without any limitations

27
New cards

Additional overhead

dynamic length strings, despite being flexible the _ _ must also be considered

28
New cards

String Assignment

most common operations on strings (1)

29
New cards

String concatenation

most common operations on strings (2)

30
New cards

Substring Reference

returns a reference to the first occurrence of the substring being searched

31
New cards

Lexical Comparison

checks if a string is lexically greater than or less than or equal to another string

32
New cards

Pattern Matching

checks if a string follows a given pattern

33
New cards

Address of the first Char

tells where the string is in the memory

34
New cards

Address of the first char

static length and limited dynamic length strings are bound to storage only once

35
New cards

Complex Memory Management

Address of the first char, dynamic length strings requires _ _ _

36
New cards

Linked list, Adjacent Memory Cells

Address of the first char, dynamic length can be implemented using _ _ or _ _ _

37
New cards

String Type

specifies the type of the string

38
New cards

Fixed

string length, for static strings ->its _ length

39
New cards

Current

string length, for dynamic strings ->its _ length

40
New cards

Current, Max

string length, for limited dynamic strings ->its _ length and _ length