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.

Part ofComputing ScienceSoftware design and development

Data types

Variables are stored in RAM but it is necessary to let the program know the type of data that each variable will hold.

Data typeDescriptionSample data
INTEGERStores positive or negative whole numbers17
REALStores numbers that contain decimal places/values and can also store integers17.65
CHARACTERStores a single character which can be a letter, number or symbol$
STRINGStores 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 REALBitesize
BOOLEANStores True or False only. This is sometimes taught as 1 or 0 only where 1 is true and 0 falseTrue
Data typeINTEGER
DescriptionStores positive or negative whole numbers
Sample data17
Data typeREAL
DescriptionStores numbers that contain decimal places/values and can also store integers
Sample data17.65
Data typeCHARACTER
DescriptionStores a single character which can be a letter, number or symbol
Sample data$
Data typeSTRING
DescriptionStores 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 dataBitesize
Data typeBOOLEAN
DescriptionStores True or False only. This is sometimes taught as 1 or 0 only where 1 is true and 0 false
Sample dataTrue