2.2.2 - Data Types Flashcards
What is an Integer?
A data type used to store positive and negative whole numbers
What is a Real?
A data type used to store numbers with a fractional part (decimals)
What is a Boolean?
A data type used to store one of two states, true or false
(or 0 & 1 or 0 & -1)
(often translated to yes/no, on/off)
What is a Character?
A single alphanumeric
What is a String?
A sequence of characters often stores as a variable in computer programs
Can include letters, numbers and symbols
What is Casting?
Converting a variable from one data type to another
Why is Casting necessary?
So sub-problems receive data in a format they are expecting
(allows numbers to be manipulated as strings, strings to become numbers etc.)