wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Pseudocode and Error Tracing

Total questions: 26

Worksheet time: 24mins

Name
Class
Date
1.

A condition is

a)

a statement that is either True or False

b)

a string

c)

an integer

d)

a list

2.

We need variables to:

a)

store and manipulate data.

b)

store data.

c)

manipulate data.

d)

make fun of students.

3.

When a piece of code runs unintentionally forever it is known as

a)

An infinite loop

b)

A long loop

c)

A broken loop

d)

A for loop

4.

Which are the lines that contains errors

a)

3,4,6,7

b)

5,6,7,9

c)

5,6,8,9

d)

2,3,4,9

5.

IF statement is a ___________________________ statement?

a)

Assignment

b)

Sequence

c)

Selection

d)

Loop

e)

Honestly , I don't know

6.

Will the following loop run?

a)

Yes

b)

No

7.
An identifier is the ‘name’ given to a variable. For example: 
distanceToSchool = 10
Which part is the identifier?
a)
10
b)
=
c)
distanceToSchool
8.
An identifier is the ‘name’ given to a variable. For example: 
distanceToSchool = 10
What is the value of the variable?
a)
10
b)
=
c)
distanceToSchool
9.
Which of the following assignment statements is assigning a number .
a)
myAge = 21
b)
myAge = "21"
10.
Which of the following assignment statements is assigning text.
a)
myName = "David"
b)
myAge = 21
11.
a)

All done.

b)

Inside the If.

c)

Inside the if.

All done.

d)

Inside the else.

All done.

e)

Inside the if.

Inside the else.

All done.

12.
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
13.
Syntax errors are caused by incorrectly typed source code.
a)
True
b)
False
14.
A program won't run if there is a logic error.
a)
False
b)
True
15.
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
16.
A program may never contain both syntax and logic errors.
a)
False
b)
True
17.
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
18.

A _________error occurs when program execution comes to an unexpected halt or ‘crash’ or it goes into an infinite loop and ‘freezes’.

a)

logic

b)

syntax

c)

run-time

19.

The procedure, FindRepeats, is written assuming there are 100 elements in

UserNameArray.

In the main program, the global array, UserNameArray, has been declared with only

50 elements.

State the type of error this will cause.

a)

Logic Error

b)

Run-time Error

c)

Syntax Error

20.

What does the code output?

a)

0

1

2

3

b)

1

2

3

c)

0

1

2

21.

What does the code output?

a)

hi

bye

b)

hi

bye

hi

bye

hi

bye

c)

hi

hi

hi

bye

22.

What does the code output?

a)

3

b)

6

c)

7

d)

4

23.

What does the code output?

a)

hi

hi

b)

hi

c)

hi

hi

hi

d)

hi

hi

hi

hi

24.

What does the code output?

a)

3

4

5

b)

1

2

3

c)

3

4

5

6

d)

3

4

4

25.

What is the value of i after this loop runs?

a)

i = 20

b)

i = 19

c)

i = 10

d)

i = 0

26.

What does this program output?

a)

x is 0

b)

x is 1

c)

x is 3

d)

x is 4