WorksheetsGCSE Computer Science Data types
Total questions: 18
Worksheet time: 9mins
Which data type is used for whole numbers
sting
real
floating point
integer
Which data type is used for text
integer
String
Mod
real
Which data type is used for a decimal number
decimal
real
floating point
integer
Which data type would be best to record the gender of a pupil
character
integer
string
real
Which of these would not be considered the character data type?
M
F
MAN
G
Individual letters can be taken from a string. Which of the following would output the length of the string Borland
OUTPUT LENGTH(Borland)
OUTPUT LEN(Borland)
OUTPUT LEN(TEACHER)
OUTPUT LENGTH(TEACHER)
What would the output be from the code Len(Chelsea)
5
6
7
8
The number 9 is stored in a program as a string. Why is this the wrong data type for the number 9?
Numbers should simply be always stored as strings
the programmer might think 9 is the letter "p"
Calculations can only be done with integers not strings.
It isnt really a problem
To convert a piece of data stored in a string into a whole number you should use the code....
STRING_TO_INT
INT_TO_STRING
STRING_TO_REAL
STRING_TO_FLOAT
To convert a piece of data stored in a string into a decimal number you should use...
STRING_TO_INT
INT_TO_STRING
STRING_TO_REAL
STRING_TO_FLOAT
To convert a whole number into a string you should use...
INT_TO_STRING
INT_TO_TEXT
INT_TO_LETTERS
REAL_TO_STRING
Which data type is also used by a logic gate?
BOOLEAN
STRING
INTEGER
REAL
Variables with the boolean data type have two possible states. Which are they?
TRUE
ON
FALSE
OFF
You can use the code SUBSTRING() to output a single letter from a whole string. With the input "Computer", what would the output from the code SUBSTRING(2, Computer). Indexing starts at 0.
m
o
p
u
You can use the code SUBSTRING() to output a single letter from a whole string. With the input "Computer", what would the output from the code SUBSTRING(2, 5, Computer). Indexing starts at 0.
m, e
o, t
m, t
o, e
You can use the code SUBSTRING() to output a single letter from a whole string. With the input "Computer". Which of the following SUBSTRING codes would produce an output which would also be a real word.
SUBSTRING(0, 4, 5, Computer)
SUBSTRING(5, 6, 7, 2, Computer)
SUBSTRING(2, 4, 5, 6, Computer)
SUBSTRING(7, 6, 0, 5, 4, 2, Computer)
CHAR_TO_CODE can be used to convert a letter into its ASCII number. CHAR_TO_CODE(A) would OUTPUT "66". What would CHAR_TO_CODE(B) output?
70
65
67
68
CODE_TO_CHAR can be used to convert a number into its matching letter in the ascii tabler. CODE_TO_CHAR(70) would OUTPUT "E". What would CHAR_TO_CODE(73, 68,68) output?
HOOT
GOO
HCC
EAL
