Programming Flashcards

(11 cards)

1
Q

What are constant definitions?

A

Doesn’t change throughout the program
[can be global (g)]
[can be local to module (m)]
[can be local to routine]
[doesn’t use a variable that could get changed accidentally]

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

The category for number data types integers explained

A

Byte ; unassigned ; 0 to 255
Short; signed; 2 bytes; -32768 to 32767
int (integer); signed ; 4 bytes
Long ; signed ; 8 bytes

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

The category for number data types real number explained

A

floating single; signed ; 4 bytes

double ; signed ; 8 bytes [could lead to unexpected results when comparing / doing calculations]

decimal; signed ; 16 bytes [more precise than single or double]

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

The category for number data types character explained

A

Char; single unicode ; 2 bytes eg “A” , “&”
String; string of text; as required [no fixed storage allocated; dynamic] eg “hello world”

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

What is boolean and dataTime number data types?

A

bool; True/false , 1 bit
dataTime: stored as a real number, 8 bytes; spans from 1 jan 0001 ro 31 december 9999

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

What are records?

A

When you create a data structure that groups together several variables ; once the structure has been defined you can declare a variable with the structure as its data type

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

What are fields?

A

The individual variable that is part of the record
You can access the individual fields using RecordVariableName.FieldNamezs

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

What are global variables? declarations

A

Declared at the beginning , can be accessed anywhere within the program

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

What are local variables?

A

Declared within the routine/subroutine that requires it

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

What is an example of an abstract data type?

A

Examples of ADTs include stacks, queues, and lists.

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

Fill in the blank: A dictionary in Python is implemented as a __________.

A

hash table

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