Programs need to be able to store
data such as texts, whole numbers,
decimal numbers, etc
Data types such as integers and strings
are used to store these peices of text,
numbers, etc
Each data type is stored in
the computer's main
memory
Data types also restrict the actions that can be carried
out on them. This helps reduce human mistakes such as
trying to multiply two letters together.
Strings
Strings are used to store text and sequences of
characters
Eg "Hamster", "Rasperry Fudge Cakes"
Integer
Integers are used to store positive and negative
whole numbers, as well as the number zero
Eg 42, 0, -100, 64
Real
Real data tyoes are used to store positive and negative
decimal numbers or fractions.
Eg 0.5, 1.236, -5.6
Boolean Variables
Booleans are used to store only two values: True or False
Eg True, or False
One Dimensional (1-D) Arrays
Many programs requie data to be stored and
manipulated not as a single itme but as a list of
related data entries.
An array is used to store a collection of data
where the data is all the same data type
Each Element in the array is identified by using an array name and
an index number which corresponds to the datas location in the
array