NEW
Font size
WorksheetsFundamentals of Programming (GCSE Computer Science AQA)
Total questions: 22
Worksheet time: 12mins
What is selection programming?
A condition selects which code to repeat.
A condition selects which lines of code to run.
Any code that selects variable assignments.
Selecting to run every single line of code.
While loops and for loops are examples of ...
selection programming.
sequential progtramming.
iteration programming.
boolean programming.
name <-- USERINPUT("Enter name: ")
pirateName <-- "Cap'n" + name
OUTPUT "Aye aye " + pirateName
This is iteration programming.
This is selection programming.
This is Python programming.
This is sequence programming.
A real/float data type is ...
Any decimal or whole number, positive or negative.
Any whole number, positive or negative.
Any real word in the dictionary.
Any True boolean statement.
The name of the data type that is either true or false:
Integer
Real
Boolean
String
Which data type can be described as a list of a different data type.
Integer
Character
Boolean
String
Select the valid structure for a single if statement:
IF ELIF ELIF ELSE ELSE
IF ELIF ELIF ELIF ELSE
ELIF IF ELIF ELIF ELSE
IF IF ELIF ELIF ELSE
a <-- 7
IF a <= 5 AND a >= 0 THEN
a <-- 5
ELIF a > 5 THEN
a <-- a
ELSE
a <-- 0
ENDIF
OUTPUT a
Final output is 7.
Final output is 0.
Final output is 5.
Syntax error, final output cannot be determined.
Where does the selection statement start?
a <-- 7
IF a <= 5 AND a >= 0 THEN
a <-- 5
ELIF a > 5 THEN
a <-- a
ELSE
a <-- 0
ENDIF
OUTPUT a
line 1
line 2
line 4
line 6
Which line uses variable assignment?
a <-- 7
IF a <= 5 AND a >= 0 THEN
a <-- 5
ELIF a > 5 THEN
a <-- a
ELSE
a <-- 0
ENDIF
OUTPUT a
line 1
line 2
line 4
line 6
Which lines uses a boolean operator?
a <-- 7
IF a <= 5 AND a >= 0 THEN
a <-- 5
ELIF a > 5 THEN
a <-- a
ELSE
a <-- 0
ENDIF
OUTPUT a
Line 1
Line 2
Line 4
Line 6
When does the for loop start?
total <-- 0
FOR i <-- 1 TO 5
total <-- total + i
ENDFOR
OUTPUT total
Line 1
Line 2
Line 3
Line 5
Which line adds a value on to total?
total <-- 0
FOR i <-- 1 TO 5
total <-- total + i
ENDFOR
OUTPUT total
Line 1
Line 2
Line 3
Line 5
How many times will this loop run?
total <-- 0
FOR i <-- 1 TO 5
total <-- total + i
ENDFOR
OUTPUT total
3
4
5
6
What boolean logic gate is this?
AND
OR
NOT
XOR
Which boolean Logic Gate is this?
AND
OR
NOT
XOR
Which Boolean Logic Gate is this?
AND
OR
NOT
XOR
What will be printed?
a <-- TRUE
b <-- FALSE
IF (a AND b) OR (NOT b) THEN
OUTPUT "Yes"
ELSE
OUTPUT "No"
Yes
No
Yes No
Nothing will be printed.
A is ON, B is OFF, C is ON.
What is the final Z output.
ON
OFF
3
Impossible to tell
T is ON C is OFF R is ON.
What is the output at W?
ON
OFF
3
Nothing.
year <-- "19"
name <-- hedgest
username <-- year + name
What does the + do?
Adds together numbers
String concatenation
Adds together variables
Signifies upper case.
What is the final output?
message <-- "hello"
OUTPUT CAPITALISE(message)
MESSAGE
HELLO
hello
Hello
