WorksheetsYear 9 Michaelmas Revision
Total questions: 30
Worksheet time: 30mins
Convert denary 35 to binary
00110101
100011
100010
11100
Convert binary 11001 to denary
19
25
49
48
Convert hexadecimal 0xA5 to binary
10100101
10110101
01011010
11000011
Convert binary 11001001 to hexadecimal
0xB9
0xA9
0xC9
0xCA
Multiply the binary number 101 by 4
1010000
10100
1010
101100
Divide the binary number 11010 by 2
110100
11010
1101
110
How much green is there in the HTML colour #AFB40A
AF
B4
0A
40
Can you double the hex value 0x55, leaving your answer in hex?
0x110
0x1010
0xAA
0x120
What is it called when there is not enough memory reserved for the result of a calculation?
Crash
Memory Dump
Overflow
Error
What is an expert system an example of?
Selection
Top-test iteration
Bottom-test iteration
Input
What algorithmic term does IF .. THEN .. ELSE .. ENDIF demonstrate
Top-test iteration
Bottom-test iteration
Selection
What algorithmic term does WHILE .. DO .. ENDWHILE demonstrate
Top-test iteration
Bottom-test iteration
Selection
What algorithmic term does REPEAT .. UNTIL demonstrate
Top-test iteration
Bottom-test iteration
Selection
If an algorithm has to repeat an action at least once, what pseudocode should you choose?
IF .. THEN .. ELSE .. ENDIF
WHILE .. DO .. ENDWHILE
REPEAT .. UNTIL
INPUT
If an algorithm has to repeat an action zero or more times, what pseudocode should you choose?
IF .. THEN .. ELSE .. ENDIF
WHILE .. DO .. ENDWHILE
REPEAT .. UNTIL
INPUT
If an algorithm has to choose what action to do next from two options, which is only done once, what pseudocode should you choose?
IF .. THEN .. ELSE .. ENDIF
WHILE .. DO .. ENDWHILE
REPEAT .. UNTIL
INPUT
Which of these is a valid variable name?
Two Choices
2Choices
TwoChoices
Two-Choices
Which code demonstrates assignment in a computer program?
x = 4
x == 4
x + 4
addFour(x)
Which code will allow a user to enter a number into a variable called num?
input(num)
input(num) = int
int = num(input())
num = int(input())
What code will allow a user to enter a word into a variable called password?
input(pasword)
password = input
password = input()
input = password
which code will print 'Hi' if x is not 4 (ignore new lines)?
if x == 4 : print("Hi")
if x != 4 : print("Hi")
if x <> 4 : print("Hi")
if x is not 4 : print("Hi")
which code will print 'Ho' if x is between 3 and 7 (ignore new lines)?
if x > 3 and x < 7: print("Ho")
if x < 3 and x > 7: print("Ho")
if x > 3 or x < 7: print("Ho")
if x < 3 or x > 7: print("Ho")
which code will print 'Foo' if y is not between 5 and 8 (ignore new lines)?
if y <= 5 or y >= 8 : print("Foo")
if y =< 5 or y => 8 : print("Foo")
if y > 5 and y < 8 : print("Foo")
if y >= 5 and y <= 8 : print("Foo")
If x is 9 and y id 10, which line of code would print "x is 9 and y is 10"?
print("x is", x, "and y is", y)
print("x is" x "and y is" y)
print("x is", y, "and y is", x)
print("x is," x, "and y is," y)
What would this code print?
Ha 0
Ha 1
Ha 2
Ho
Ha 1
Ha 2
Ho
Ha 0
Ha 1
Ho
Ha 0
Ho
Ha 1
Ho
Ha 2
Ho
What would this code print?
Zed
Why
Ex
Why
Ex
What algorithmic structure does this code mainly demonstrate?
Top-test iteration
Bottom-test iteration
Selection
Expert system
Which line numbers demonstrate assignment?
5
1 & 5
1 & 4
3 & 7
What would be printed by this code?
Hum
Drum
Hum
Hum
Drum
Hum
Drum
Hum
Drum
Hum
Hum
Hum
Drum
How many syntax errors are there in this code?
4
5
6
7
