
Selecting and justifying common data types questions and answers
Q1. What is an ‘integer’? Give some examples to illustrate your understanding.
A1. Any whole number e.g. -56, 0, 6783
Q2. What is a ‘real number’? Give some examples to illustrate your understanding.
A2. Any number with a fractional part e.g. -4.7, 0.00, 34.0, 534.6
Q3. What is a Boolean value? Give some examples to illustrate your understanding.
A3. Any value which can hold TRUE or FALSE e.g. Married? Under16?
Q4. What is a data type ‘character’? Give some examples to illustrate your understanding.
A4. Any single character from the keyboard e.g. 4, H, @
Q5. What is a data type ‘string’? Give some examples to illustrate your understanding.
A5. A string is a set of characters, in other words, any number of characters from the keyboard e.g. Hello, 4534, %^gt&78?
Q6. What is meant by declaring a variable?
A6. This means setting up a variable so it can be used. Typically, you have to give a variable a name and state what data type it will be used for.
Q7. What is meant by declaring a constant?
A7. This means setting up a constant so it can be used.
Q8. What is meant by initialising a variable?
A8. This means giving the variable a starting value.
Q9. What is a variable?
A9. A variable is a box or area in RAM. Instead of using RAM addresses, you use a name. This means that the operating system can decide which RAM addresses to use when the program is run.
Q10. Do some research. Many languages use 'arrays'. Describe what an array is.
A10. An array is a data structure. You use it to hold a collection of data. You typically have to give the array a name, say how big you want it (how many data items you are likely to want to store) and also what data type it will hold, as arrays usually can hold data of one data type only.