1.4.1: Data Types Flashcards
1
Q
Why is it essential to store data as the right data type?
A
- So the right operations can be performed on it
2
Q
What is an Integer?
A
- A whole number
3
Q
What are Integers used for?
A
- Counting things
4
Q
What are Real numbers useful for?
A
- Measuring things
5
Q
What is a Real number?
A
- A positive or negative number which can, but does not necessarily, have a fractional part
6
Q
What is a Character?
A
- A single symbol used by a computer
- Letters A to Z, the numbers 0 to 9, and other symbols such as punctuation and characters from other languages
7
Q
What is a String?
A
- A collection of characters
- Can be used to store either a single character or many characters in succession
8
Q
What are Strings useful for?
A
- Storing text and phone numbers, which start with 0, which numeric data types such as integers would cut off
9
Q
What is Boolean?
A
- True or False
10
Q
What is Boolean useful for?
A
- Recording data that can only take two values, like the state of a power button or whether a line of code has been executed
11
Q
What is a Character Set?
A
- A published collection of codes and corresponding characters which can be used by computers for representing text
12
Q
What is ASCII?
A
- American Standard Code for Information Interchange
- Normal ASCII uses 7 bits to represent 128 characters
- Extended ASCII uses 8 bits to represent 256 characters (The first 128 codes code are the same as in normal ASCII)
13
Q
How many bits does Unicode utilise?
A
- A varying number of bits ranging from 16 to 32, allowing for over 1 million different characters, many of which have yet to be allocated
- Unicode has enough capacity to represent a wealth of different languages, symbols, and emojis