Top 16: Data Types and Structures Flashcards
A variable is a
data item required to be input by user when a program is run.
When declaring, a variable creates a
storage area in memory where variable will be held while the program is run
To declare a variable we must
identify all the variable which will be used by the program and their data types
There are 5 data types and they are;
string, integer, real, boolean, 1D arrays
String is used to hold
text, for examples names and addresses. (alphanumeric data)
Integer is used to hold
a number with no decimal parts, e.g. 4, -2
Real is used to hold
number with fractional parts, e.g. 3.7
A boolean is
a data type that hold only one of two values. e.g. yes or no, true or false
A 1D array is a sepcial category of variable because
it can hold multiple pieces of similar data whereas normal data can only hold one. E.g. a highscore on a game
A fixed loop will
go through the code a set number of times.