wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

GCSE J277 - 2.3.2 - Syntax and Logic Errors

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.
print(Hello",name)
a)
Syntax Error
b)
Logic Error
2.
print("In 5 years time, you will be", age * 5)
a)
Syntax Error
b)
Logic Error
3.
if i in range(0,2):
a)
Syntax Error
b)
Logic Error
4.
if num < 5: print("The number is larger than 5")
a)
Syntax Error
b)
Logic Error
5.
Once a logical condition in an IF statement is TRUE, all other statements are are ignored
a)
True
b)
False
6.
Syntax errors are always spotted when the program is compiled or interpreted
a)
True
b)
False
7.
A program won't run if there is a logic error
a)
True
b)
False
8.
Syntax errors are caused by incorrectly typed source code
a)
True
b)
False
9.
Modern IDEs can spot syntax errors are you type your code
a)
True
b)
False
10.
Which statement best describes a logic error
a)
An error in a program caused by hardware failure
b)
An error in the program caused by mis-spelt instructions
c)
An error that produces incorrect outputs but not crash
d)
An error that causes it to crash
11.
Which statement contains a syntax error
a)
print("Hello")
b)
PRINT("Hello")
c)
print("hello")
d)
print("HELLO")
12.
Which statement contains a syntax error
a)
pounds = pence * 100
b)
pounds = pence / 100
c)
pounds = pence x 100
d)
pounds = 100 / pence
13.
A program may never contain both syntax and logic errors
a)
True
b)
False
14.
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) * 2
d)
answer = 2 + 3 x 2
15.
Using incorrect comparison operators such as < or > is an example of what type of error
a)
Syntax Error
b)
Logic Error
16.
Using incorrectly named programming functions is an example of what type of error
a)
Syntax Error
b)
Logic Error
17.
These types of errors can only be detected by the programmer themselves
a)
Syntax Error
b)
Logic Error
18.
These types of errors are generally detected by the IDE
a)
Syntax Error
b)
Logic Error
19.
Which type of errors are easier to identify
a)
Syntax Error
b)
Logic Error
20.
A program will still run even with this type of error
a)
Syntax Error
b)
Logic Error