Worksheets2.1.2 Common errors
Total questions: 10
Worksheet time: 6mins
Name
Class
Date
1.
Syntax errors are always spotted when the program is compiled or interpreted.
a)
True
b)
False
2.
Which of these pseudocode statements is an example of a logic error?
a)
FOR x=0 TO 10 STEP -1
b)
FOR x=0 TO 10 STEP 1
c)
FOR x=10 TO 0 STEP -1
d)
FOR x=0 TOO 10 STEP 1
3.
What is an algorithm?
a)
Patterns and trends used to solve a problem
b)
A set of step-by-step instructions to resolve a problem
c)
A programming language
4.
Which of the following assignment statements is assigning a number .
a)
myAge = 21
b)
myAge = "21"
5.
Which of the following assignment statements is assigning text.
a)
myName = "David"
b)
myAge = 21
6.
Which of these pseudocode statements contains a syntax error?
a)
pounds = pence x 100
b)
pounds = pence * 100
c)
pounds = pence / 100
d)
pounds = 100 / pence
7.
Which statement best describes logic errors?
a)
An error in a program that causes it to produce incorrect ouputs but not a crash.
b)
An error in a program that causes it to crash.
c)
An error in the program caused by mis-spelt instructions.
d)
An error in a program caused by hardware failure.
8.
Which of these expressions will generate a logic error when the expected output is 10?
a)
answer = 2 + 3 * 2
b)
answer = (2 + 3) * 2
c)
answer = 2 + 3 x 2
d)
answer = {2 + 3} * 2
9.
Which line contains a syntax error?
a)
print("Hello")
b)
sprint("Hello")
c)
print("hello")
d)
print("HELLO")
10.
A program won't run if there is a logic error.
a)
False
b)
True
100 %
