Implementation: Data types and structuresData types
Data is stored differently depending on its type. Numbers are stored as integers or real numbers, text as string or characters. Lists of the same type of data can be stored in an array.
Variables are stored in RAM but it is necessary to let the program know the type of data that each variable will hold.
Data type
Description
Sample data
INTEGER
Stores positive or negative whole numbers
17
REAL
Stores numbers that contain decimal places/values and can also store integers
17.65
CHARACTER
Stores a single character which can be a letter, number or symbol
$
STRING
Stores alphanumeric combinations and text. String is really a group of characters stored together as one. Numbers to be used for calculations should not be stored as string data even though they can be. They should be stored as INTEGER or REAL
Bitesize
BOOLEAN
Stores True or False only. This is sometimes taught as 1 or 0 only where 1 is true and 0 false
True
Data type
INTEGER
Description
Stores positive or negative whole numbers
Sample data
17
Data type
REAL
Description
Stores numbers that contain decimal places/values and can also store integers
Sample data
17.65
Data type
CHARACTER
Description
Stores a single character which can be a letter, number or symbol
Sample data
$
Data type
STRING
Description
Stores alphanumeric combinations and text. String is really a group of characters stored together as one. Numbers to be used for calculations should not be stored as string data even though they can be. They should be stored as INTEGER or REAL
Sample data
Bitesize
Data type
BOOLEAN
Description
Stores True or False only. This is sometimes taught as 1 or 0 only where 1 is true and 0 false