1.4 Data Types and Structures Flashcards
What is a data type?
Formal classification of the type of data being stored or manipulated within a program to determine which operations can be performed on that data
What are primitive data types?
Common data types built into the language which can only contain one value
What are some examples of data types?
Integer
Float/real
Boolean
Char
String
What is an integer?
A positive or negative whole number
What is an example of an integer?
1
-98
38420
What is float/real?
A positive or negative number which can include decimal points
What is an example of a float/real?
1.849
-45.3
What is a Boolean?
Only one of True or False
What is an example of a Boolean?
True
False
What is a char?
A single character
What is an example of a char?
“a”
”#”
“5”
What is a string?
Not a primitive data type but a basic one in most languages
Collection of char data types
What is an example of a string?
“hello!”
“sh63£”
What is a composite/compound data type?
Built by combining primitive data types
What is an example of a composite/compound data type?
Record
Class
What is a data structure?
Collection of data organised to allow efficient processing
Lend themselves to different applications
Some highly specialised to specific tasks
What is an abstract data type?
Conceptual model
Describes how data is organised and which operations can be carried out on data
From perspective of end-user who doesn’t need to know how it’s implemented
What is binary?
Base 2
Uses 1s and 0s
List the forms of storage (e.g. bit, byte) from smallest to largest
Bit
Nibble
Byte
Kilobyte
Megabyte
Gigabyte
Terabyte
Petabyte
What is a bit?
A single 1 or 0
Smallest form of data storage in a computer
What is a nibble?
4 bits
What is a byte?
8 bits
2 nibbles
What is a kilobyte?
1000 bytes
What is a megabyte?
1000 KB