Font size
Worksheets10 min test 22
Total questions: 21
Worksheet time: 12mins
Which logic gate gives an output of 0 if both inputs are 0?
AND gate
OR gate
Both AND and OR gates
Given that x = "CompSci" and test = x.substring(4,1) what is the output of print(test)?
S
p
Comp
Given that x = "CompSci" and test = x.substring(4,1) What would
print (x + test) output?
CompSciS
CompScip
CompScIComp
The highScore variable has an integer data type. Using the correct data type makes code...
more memory efficient
less memory efficient
more robust
less robust
The flow of this program is controlled by
a selection statement
an interation statement
both selection and iteration statements
Which of these inputs would have resulted in the output 'Invalid score entered'
1
1.1
101
What would the program output if the input was 90?
You equalled the high score
New high score, well done!
You did not beat the high score
What is the output of this logic circuit?
A = 1
B = 1
0
1
The substring function is a string-manipulation technique.
What are the other string manipulation tools?
casting
.upper
.lower
concatenation
.len
Which of the below are data types?
substring
variable
string
float
Boolean
Define selection and state the code statements used to perform selection.
the process of making a decision
the process of looping back to a previous line of code and executing it again
IF THEN ELSE
FOR / WHILE / UNTIL
SWITCH CASE
Define iteration and state the code statements used to perform iteration.
the process of making a decision
the process of looping back to a previous line of code and executing it again
IF THEN ELSE
FOR / WHILE / UNTIL
SWITCH CASE
The program has a variable called highScore.
What is a variable?
A named memory location which stores a value that can change whilst the program is running
A named memory location which stores a value that can't change whilst the program is running
A data structure which holds similar/related values
Which is the assignment operator and what is it's function?
checks to see if two values are the equavalent
assigns a value to a variable
=
==
Which is the 'equal to' operator and what is it's function?
checks to see if two values are the equavalent
assigns a value to a variable
=
==
What would the code do if B was input?
the listusers() procedure would be called
the createuser() function would be called
the createuser() procedure would be called
"Not a valid choice" would be ouput
A local variable
is accessible throughout the entire program
is confined to use within iteration or a subprogram
A global variable
is accessible throughout the entire program
is confined to use within iteration or a subprogram
What data type would be most suitable for storing the amount of people that attended a football match. This data will then be used to work out the attendance figures to matches.
integer
real/float
string
boolean
What data type would be most suitable for storing the weight of babies when they are born?
integer
real/float
string
boolean
What data type would be most suitable for storing the house number and road name of an address.
integer
real/float
string
boolean
