Font size
WorksheetsY9 Programming Test
Total questions: 40
Worksheet time: 1hrs 20mins
The process of finding errors in your code and removing or solving them is called?
Filtering
Probing
Debugging
Refining
Manisha had written the following code and when she runs it, she receives an error.
What does she need to do for the code to run as expected
Include commas in the print statement
The user input needs to be cast to the correct datatype
Remove the brackets in the print statement
Replace the speech marks with single quote marks
What term do we give to code that contain actions that must be execute one after the other without skipping any?
Iteration
Sequence
Selection
Decomposition
This code is an example of which programming construct?
Sequence
Iteration
Decomposition
Selection
This code is an example of which programming construct?
Iteration
Sequence
Decomposition
Selection
Which of the following makes use of a function?
total = price * quanitity
name = "Minahil"
while grade != 5:
name = input("Enter your name")
What arithmetic operator should replace the + to give the correct total of ticket sales?
//
/
%
*
A program has been written to validate the height of a child wishing to ride a roller coaster. The program is run and 1.5 is entered as the height.
What does the program output?
You are too tall to ride the roller coaster
Nothing
You are not tall enough to ride the roller coaster
You can ride the roller coaster
Which of these relational operators would be needed to check if a variable holds a value greater or equal to 100?
<
>
<=
>=
A program has been written to validate user input in response to a question. The Boolean operator AND has been used, this is incorrect. What Boolean operator should be used instead?
EQUALTO
XOR
NOT
OR
The following code stores items that have been added to a bag in a video game. Which piece of code will replace "Jet boots" with "Super Hammer" in the list?
bag[3] = Super Hammer
bag[4] = "Super Hammer"
bag[2] = "Super Hammer"
bag[1] = Super Hammer
Which of the following is NOT true about lists?
A list can store a collection of data items
A list has an index
list.length() is used to find the length of a list
A list can only store store data of a single type
What would this code output?
True
False
NOT C
C
What is colour an example of?
Relational operator
Boolean operator
Variable
Constant
Which of these code snippets could be used as a selection statement?
while x < y:
if x == y:
print("Hello")
for i in range(0,3):
What would this program output when run?
tick, tock, tick, tock
tick, tick, tick
tick, tick, tick, tock
tick, tick, tock
What would this program output?
86
14
48
totalPoints
This code is an example of which programming construct?
Iteration
Sequence
Selection
Decomposition
What will this program output when run?
5,6,7,8,9,10
11,12,13,14,15
10,20,30,40,50
10,10,10,10,10
What will be output as a result of the program?
18
10
14
12
In programming terms what is a sequence?
A piece of code that is not used
A special programming language
A series of instructions carried out one after another in order
A piece of hardware that the program is stored on
Which of the following means not equal to?
==
=
!=
<
if you entered 7%2 what result would you get in python?
3
1
2
0
Which of the following is NOT a suitable variable name?
num1
Num1
MyName
My name
If you type 10/5 what result would you get in python?
2
2.0
0
15
What is the syntax error in this code?
Incorrect use of variable
The code is not indented correctly
Missing : character at the end of the else statement
Missing brackets
What is the syntax error in this code?
Incorrect use of variable
Missing : characters at the end of the if and else statements
The code is not indented correctly
Missing brackets
What is the coder's word for converting one data type into another?
casting
throwing
catching
What would be the answer here?
x = "hello"
print(len(x))
2
3
4
5
Which of the following input statements are correct?
input="Enter your name")
name =input enter your name
name=input("Enter your name")
name=input["Enter your name"]
Which statement prints 7 (Select 2 answers)
print 7
print("7"
print("7")
print(3 + 4)
Why do we test our programming code
To show how good it is
To find and remove any errors
Because if we make a mistake our program will delete itself
To add extra functions to our program
False
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
(repeated continuously)
