Programming Flashcards
(11 cards)
What are constant definitions?
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]
The category for number data types integers explained
Byte ; unassigned ; 0 to 255
Short; signed; 2 bytes; -32768 to 32767
int (integer); signed ; 4 bytes
Long ; signed ; 8 bytes
The category for number data types real number explained
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]
The category for number data types character explained
Char; single unicode ; 2 bytes eg “A” , “&”
String; string of text; as required [no fixed storage allocated; dynamic] eg “hello world”
What is boolean and dataTime number data types?
bool; True/false , 1 bit
dataTime: stored as a real number, 8 bytes; spans from 1 jan 0001 ro 31 december 9999
What are records?
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
What are fields?
The individual variable that is part of the record
You can access the individual fields using RecordVariableName.FieldNamezs
What are global variables? declarations
Declared at the beginning , can be accessed anywhere within the program
What are local variables?
Declared within the routine/subroutine that requires it
What is an example of an abstract data type?
Examples of ADTs include stacks, queues, and lists.
Fill in the blank: A dictionary in Python is implemented as a __________.
hash table