wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IGCSE Pseudocode Practice

Total questions: 119

Worksheet time: 3570secs

Name
Class
Date
1.

How are lines indented in pseudocode to indicate containment within a previous statement?

a)

Two spaces

b)

Three spaces

c)

Four spaces

d)

Five spaces

2.

If a statement in pseudocode does not fit on one line, how are continuation lines indented?

a)

One space

b)

Two spaces

c)

Three spaces

d)

Four spaces

3.

In pseudocode, what indentation is used for THEN and ELSE clauses of an IF statement?

a)

One space

b)

Two spaces

c)

Three spaces

d)

Four spaces

4.

What is the indentation style for cases in CASE statements in pseudocode?

a)

One space

b)

Two spaces

c)

Three spaces

d)

Four spaces

5.

Continuation lines in pseudocode are indented by (a)   spaces from the margin.

6.

How are keywords represented in the pseudocode as per the syllabus?

a)

Lower case

b)

Mixed case

c)

Upper case

d)

Italics

7.

What is the case convention for identifiers in pseudocode?

a)

Lower case

b)

Mixed case

c)

Upper case

d)

Italics

8.

How is a comment indicated in pseudocode?

a)

One forward slash (/)

b)

Two forward slashes (//)

c)

Hash symbol (#)

d)

Double asterisks (**)

9.

In pseudocode, keywords are written in (a)   case.

10.

Identifiers in pseudocode follow a (a)   case convention.

11.

Which keyword in pseudocode is used for a whole number?

a)

INTEGER

b)

REAL

c)

CHAR

d)

STRING

12.

How is a real number represented in pseudocode?

a)

Without a decimal point

b)

With at least one digit on either side of the decimal point

c)

As a fraction

d)

In exponential form

13.

In pseudocode, how is a single character denoted?

a)

With double quotes

b)

With single quotes

c)

Without quotes

d)

With brackets

14.

What denotes a string in pseudocode?

a)

Single quotes

b)

Double quotes

c)

Parentheses

d)

Brackets

15.

A single character in pseudocode is delimited by (a)   quotes.

16.

Boolean literals in pseudocode are represented as (a)   or FALSE.

17.

In pseudocode, TRUE and FALSE are examples of (a)   literals.

18.

The pseudocode representation of a fractional number uses the data type (a)   .

19.

A (a)   is a data type in pseudocode used for single characters.

20.

In pseudocode, identifiers must start with what type of letter?

a)

A lowercase letter

b)

A capital letter

c)

A digit

d)

An underscore

21.

Which of the following is a valid identifier in pseudocode?

a)

2ndPlayer

b)

_totalScore

c)

MaxHeight

d)

floatNumber

22.

What should identifiers in pseudocode not include?

a)

Digits

b)

Accented letters

c)

Capital letters

d)

Lowercase letters

23.

Which of the following is the correct way to declare a boolean variable named 'IsActive' in pseudocode?

a)

DECLARE IsActive: BOOLEAN

b)

BOOLEAN IsActive DECLARE

c)

DECLARE BOOLEAN IsActive

d)

IsActive: DECLARE BOOLEAN

24.

Identifiers in pseudocode should start with a (a)   letter.

25.

Using (a)   as identifier names in pseudocode is not allowed.

26.

Which of the following is the correct way to declare an integer variable named 'ItemCount' in pseudocode?

a)

INTEGER DECLARE ItemCount

b)

DECLARE ItemCount: INTEGER

c)

DECLARE INTEGER ItemCount

d)

ItemCount: DECLARE INTEGER

27.

How do you correctly declare a real number variable named 'AverageScore' in pseudocode?

a)

REAL AverageScore DECLARE

b)

DECLARE REAL AverageScore

c)

DECLARE AverageScore: REAL

d)

AverageScore: DECLARE REAL

28.

Which is the correct way to declare a string variable named 'UserName' in pseudocode?

a)

STRING UserName DECLARE

b)

DECLARE UserName: STRING

c)

DECLARE STRING UserName

d)

UserName: DECLARE STRING

29.

How is a constant with the identifier MaxSize and a value of 100 correctly declared in pseudocode?

a)

CONSTANT MaxSize = 100

b)

CONSTANT MaxSize ← 100

c)

MaxSize CONSTANT = 100

d)

MaxSize ← CONSTANT 100

30.

Choose the correct declaration for a constant named MinTemperature with a value of -5.0 in pseudocode.

a)

CONSTANT MinTemperature = -5.0

b)

MinTemperature CONSTANT ← -5.0

c)

CONSTANT MinTemperature ← -5.0

d)

-5.0 ← CONSTANT MinTemperature

31.

What is the proper way to declare a constant DefaultMessage with the string value "Hello" in pseudocode?

a)

CONSTANT DefaultMessage = "Hello"

b)

DefaultMessage → CONSTANT "Hello"

c)

"Hello" → CONSTANT DefaultMessage

d)

CONSTANT DefaultMessage ← "Hello"

32.

How would you correctly declare a boolean constant IsEnabled with the value TRUE in pseudocode?

a)

CONSTANT IsEnabled = TRUE

b)

CONSTANT IsEnabled ← TRUE

c)

IsEnabled CONSTANT = TRUE

d)

TRUE → CONSTANT IsEnabled

33.

In pseudocode, which of the following correctly declares a constant Pi with the value 3.14?

a)

Pi = CONSTANT 3.14

b)

CONSTANT Pi = 3.14

c)

Pi → CONSTANT 3.14

d)

CONSTANT Pi ← 3.14

34.

To declare a constant in pseudocode, use the format CONSTANT (a)   ? value.

35.

What is the correct syntax for assigning the value 10 to a variable named Score in pseudocode?

a)

Score = 10

b)

Score → 10

c)

Score ← 10

d)

10 ← Score

36.

How would you represent assigning the sum of two variables A and B to a variable Total in pseudocode?

a)

Total = A + B

b)

Total ← A + B

c)

A + B → Total

d)

A + B ← Total

37.

Choose the correct way to assign the boolean value FALSE to a variable IsActive in pseudocode.

a)

IsActive = FALSE

b)

IsActive ← FALSE

c)

IsActive → FALSE

d)

FALSE ← IsActive

38.

In pseudocode, how do you assign a character 'a' to a variable FirstChar?

a)

FirstChar = 'a'

b)

FirstChar ← 'a'

c)

FirstChar → 'a'

d)

'a' → FirstChar

39.

What is the correct format to assign the result of a multiplication operation (5 * 3) to a variable Product?

a)

Product = 5 * 3

b)

Product →5 * 3

c)

Product←5 * 3

d)

5 * 3 → Product

40.

Which of the following is the correct way to declare a one-dimensional array of integers with 10 elements in pseudocode?

a)

DECLARE Numbers : ARRAY[1:10] OF INTEGER

b)

DECLARE Numbers : INTEGER[1:10]

c)

DECLARE Numbers[1:10] OF INTEGER

d)

INTEGER Numbers : ARRAY[1:10]

41.

How do you declare a two-dimensional array of characters with 3 rows and 3 columns in pseudocode?

a)

DECLARE Grid : CHAR[1:3, 1:3]

b)

DECLARE Grid : ARRAY[1:3, 1:3] OF CHAR

c)

DECLARE CHAR Grid[1:3, 1:3]

d)

CHAR Grid : ARRAY[1:3, 1:3]

42.

What is the correct syntax to assign the value 'X' to the second row and third column of a 2D array GameBoard in pseudocode?

a)

GameBoard[2, 3] = 'X'

b)

GameBoard[2, 3] → 'X'

c)

GameBoard[2, 3] ← 'X'

d)

'X' → GameBoard[2, 3]

43.

Which pseudocode line correctly increments the value of the tenth element in an array Scores by 5?

a)

Scores[10] = Scores[10] + 5

b)

Scores[10] → Scores[10] + 5

c)

Scores[10] ← Scores[10] + 5

d)

Scores[10] + 5 → Scores[10]

44.

To declare a one-dimensional array of strings with 25 elements, the pseudocode is DECLARE ArrayName : ARRAY[1: (a)   ] OF STRING.

45.

Which of the following is the correct way to input a value into a variable named Age in pseudocode?

a)

INPUT Age

b)

READ Age

c)

GET Age

d)

ENTER Age

46.

How do you correctly output the value of a variable named TotalSales in pseudocode?

a)

OUTPUT TotalSales

b)

PRINT TotalSales

c)

DISPLAY TotalSales

d)

SHOW TotalSales

47.

What is the correct format to output a string followed by the value of a variable Score in pseudocode?

a)

OUTPUT "Your score is ", Score

b)

PRINT "Your score is ", Score

c)

DISPLAY "Your score is " + Score

d)

SHOW "Your score is " & Score

48.

Choose the correct pseudocode statement for inputting a value into an array element Numbers[5].

a)

READ Numbers[5]

b)

INPUT Numbers[5]

c)

GET Numbers[5]

d)

ACCEPT Numbers[5]

49.

In pseudocode, how would you output a message and the values of two variables Name and Age?

a)

SHOW "Name: " & Name & ", Age: " & Age

b)

DISPLAY "Name: " + Name + ", Age: " + Age

c)

PRINT "Name: ", Name, ", Age: ", Age

d)

OUTPUT "Name: ", Name, ", Age: ", Age

50.

The pseudocode command to display the contents of a variable Result is (a)   Result.

51.

The correct way to output the variables FirstName and LastName in pseudocode is: (a)   "Name: ", FirstName, LastName.

52.
What is the result of the pseudocode operation MOD(15, 4)?
a)
3
b)
4
c)
1
d)
7
53.
In pseudocode, how is the operation for dividing Number1 by Number2 and keeping only the quotient represented?
a)
Number1 / Number2
b)
Number1 DIV Number2
c)
DIV(Number1, Number2)
d)
Number1 MOD Number2
54.
What does the expression Answer ← 5 * 3 + 2 evaluate to in pseudocode?
a)
11
b)
17
c)
21
d)
25
55.
How do you represent squaring a number Variable in pseudocode?
a)
Variable * Variable
b)
Variable ^ 2
c)
Variable ** 2
d)
Square(Variable)
56.
What is the correct way to write an operation for finding the remainder when A is divided by B in pseudocode?
a)
A % B
b)
A / B
c)
A MOD B
d)
MOD(A, B)
57.

The expression A (a)   B in pseudocode represents multiplication of A and B.

58.

To raise a number X to the power of 3 in pseudocode, write X (a)   3.

59.

In pseudocode, the remainder of division is obtained using the (a)   operator.

60.
What is the result of the logical operation 10 <= 10 in pseudocode?
a)
True
b)
False
61.
In pseudocode, how is the condition 'variable A is not equal to variable B' represented?
a)
A = B
b)
A < B
c)
A <> B
d)
A > B
62.
What does the Boolean expression NOT (X > 5 AND Y < 10) evaluate to when X is 6 and Y is 9?
a)
True
b)
False
c)
ERROR
d)
NULL
63.
Choose the correct representation of a condition that checks if a variable Age is either below 18 or above 65 in pseudocode.
a)
IF Age < 18 OR Age > 65 THEN
b)
IF Age <= 18 AND Age >= 65 THEN
c)
IF NOT Age > 18 AND Age < 65 THEN
d)
IF Age <> 18 OR Age <> 65 THEN
64.
How is a complex Boolean condition that checks if Score is between 50 and 100 inclusive correctly written in pseudocode?
a)
IF Score >= 50 AND Score <= 100 THEN
b)
IF Score > 50 OR Score < 100 THEN
c)
IF Score = 50 OR Score = 100 THEN
d)
IF Score <> 50 AND Score <> 100 THEN
65.

In pseudocode, to check if two values are equal, the (a)   operator is used.

66.

The operator for 'greater than' in pseudocode is represented by (a)   .

67.

To combine two Boolean conditions using the logical 'or', the (a)   operator is used.

68.

The pseudocode for checking if a variable Num is not equal to 5 is Num (a)   5.

69.

In pseudocode, negating a Boolean expression is done using the (a)   operator.

70.
What is the result of the string operation LENGTH("Transportation") in pseudocode?
a)
12
b)
13
c)
14
d)
15
71.
How does the LCASE function modify the string "Freight" in pseudocode?
a)
Returns "Freight"
b)
Returns "freight"
c)
Returns "FREIGHT"
d)
Returns "fREIGHT"
72.
What will SUBSTRING("Multimodal", 1, 5) return in pseudocode?
a)
Multi
b)
modal
c)
"Multim"
d)
ultim
73.
What is the purpose of the ROUND(<identifier>, <places>) function in pseudocode?
a)
It rounds the identifier to the nearest integer.
b)
It truncates the identifier to the specified decimal places.
c)
It rounds the identifier to the specified number of decimal places.
d)
It converts the identifier to an integer regardless of decimal places.
74.
What does the RANDOM() function return in pseudocode?
a)
A random integer
b)
A random number between 0 and 1 inclusive
c)
A random number between 1 and 10
d)
A random character
75.

To find the length of a string in pseudocode, use the (a)   function.

76.

The pseudocode function UCASE converts a string or character to (a)   case.

77.

SUBSTRING("Planning", 3, 4) will return the substring (a)   from the string "Planning".

78.

In pseudocode, ROUND(Value, 2) will round Value to (a)   decimal places.

79.

To generate a random real number in the range of 0 to 1 in pseudocode, use the (a)   function.

80.
What is the correct way to write an IF statement without an ELSE clause to check if Age is greater than 18?
a)
IF Age > 18 THEN ... ENDIF
b)
IF Age > 18: ... ENDIF
c)
IF (Age > 18) THEN ... END
d)
IF Age > 18 THEN ... ELSE END
81.
How do you correctly write an IF statement with an ELSE clause to check if Score is equal to 100?
a)
IF Score = 100 THEN ... ELSE ... END
b)
IF Score == 100 THEN ... ELSE ... ENDIF
c)
IF Score = 100 THEN ... ELSE ... ENDIF
d)
IF (Score = 100) THEN ... OTHERWISE
82.
Which of the following correctly shows a nested IF statement in pseudocode?
a)
IF condition1 THEN IF condition2 THEN ... ENDIF ENDIF
b)
IF condition1 THEN ... ELSE IF condition2 THEN ... ENDIF ENDIF
c)
IF condition1 THEN ... ENDIF IF condition2 THEN ... ENDIF
d)
IF condition1 AND condition2 THEN ... ENDIF
83.
In a pseudocode IF statement, how are the THEN and ELSE clauses indented?
a)
They are not indented.
b)
Indented by one space.
c)
Indented by two spaces.
d)
Indented by four spaces.
84.
Which is the correct pseudocode structure for an IF statement with an ELSE clause containing a nested IF?
a)
IF condition THEN ... ELSE IF condition2 THEN ... ENDIF ENDIF
b)
IF condition THEN ... ELSE ... IF condition2 THEN ... ENDIF ENDIF
c)
IF condition THEN ... ENDIF ELSE ... IF condition2 THEN ... ENDIF
d)
IF condition THEN ... ELSE ... ENDIF IF condition2 THEN ... ENDIF
85.

In pseudocode, an IF statement is closed with the keyword (a)   .

86.

To add a condition that executes when the IF condition is false, use an (a)   clause.

87.

Nested IF statements in pseudocode should continue the indentation of (a)   spaces.

88.

An IF statement in pseudocode that checks if Temp is less than 0 would start with IF Temp (a)   0 THEN.

89.

In a complex decision-making process, pseudocode may require the use of multiple (a)   IF statements.

90.
What does a CASE statement do in pseudocode?
a)
Repeats a block of code multiple times
b)
Executes a block of code if a condition is true
c)
Allows execution of one out of several branches based on a variable's value
d)
Executes two different blocks of code alternately
91.
In a CASE statement, how are individual case clauses formatted?
a)
Not indented
b)
Indented by one space
c)
Indented by two spaces
d)
Indented by four spaces
92.
What is the function of the OTHERWISE clause in a CASE statement?
a)
It provides an additional condition to the existing cases
b)
It acts as a default case when none of the other cases apply
c)
It repeats the last case for emphasis
d)
It is used to exit out of the CASE statement
93.
When is a CASE statement in pseudocode considered complete?
a)
After all cases have been tested
b)
Only after the OTHERWISE case is executed
c)
After the statement following ENDCASE
d)
When a matching case is found and its statement is executed
94.
Which of the following is an appropriate use of a CASE statement in pseudocode?
a)
For complex decision-making with multiple conditions
b)
When there are several branches of code depending on the value of a variable
c)
To execute a block of code repeatedly based on a condition
d)
For decision-making processes involving only boolean variables
95.

In pseudocode, a CASE statement ends with the keyword (a)   .

96.

A CASE statement in pseudocode allows for the execution of code based on the value of a(n) (a)   .

97.

In a CASE statement, if no defined cases are applicable, the (a)   clause's statement is executed.

98.

Each case clause in a CASE statement is indented by (a)   spaces.

99.

For simple decisions based on a variable's specific values, use a (a)   statement in pseudocode.

100.
What happens in a FOR loop if value1 is greater than value2 in pseudocode?
a)
The loop executes indefinitely.
b)
The loop's statements execute once.
c)
The loop's statements do not execute.
d)
The loop executes in reverse order.
101.
How is a count-controlled FOR loop that increments the counter by 2 each time correctly written in pseudocode?
a)
FOR I ← 1 TO 10 INCREMENT 2
b)
FOR I ← 1 TO 10 PLUS 2
c)
FOR I ← 1 TO 10 STEP 2
d)
FOR I ← 1 TO 10 INCREASE BY 2
102.
In a post-condition loop (REPEAT), when is the condition tested?
a)
Before the statements in the loop are executed
b)
After the statements in the loop are executed
c)
Only during the first iteration
d)
At the beginning of each iteration
103.
What is the outcome of a FOR loop where value1 equals value2 in pseudocode?
a)
The loop's statements execute once.
b)
The loop's statements execute twice.
c)
The loop's statements do not execute.
d)
The loop results in an error.
104.
How does the REPEAT loop differ from the FOR loop in pseudocode?
a)
The REPEAT loop runs for a predetermined number of iterations.
b)
The REPEAT loop continues until a condition is met.
c)
The REPEAT loop does not allow variable increment.
d)
The REPEAT loop is only for Boolean conditions.
105.

In pseudocode, a count-controlled loop starts with FOR and ends with NEXT (a)   .

106.

A FOR loop's range is specified from value1 (a)   value2.

107.

In pseudocode, FOR I ← 1 TO 5 STEP (a)   is used to specify a specific step increment in a FOR loop.

108.

The loop type that checks its condition after executing its statements is the REPEAT (a)   loop.

109.

In a REPEAT loop, if the condition evaluates to (a)   , the loop terminates.

110.
What is the main difference between a WHILE loop and a REPEAT loop in pseudocode?
a)
A WHILE loop checks its condition before executing statements; a REPEAT loop checks after.
b)
A WHILE loop runs indefinitely; a REPEAT loop runs a fixed number of times.
c)
A REPEAT loop is used for counting; a WHILE loop is used for Boolean conditions.
d)
A WHILE loop can run zero times; a REPEAT loop always runs at least once.
111.
In which situation would a WHILE loop not execute its statements even once?
a)
The condition is always TRUE.
b)
The condition is always FALSE.
c)
The condition becomes FALSE during iteration.
d)
The condition becomes TRUE during iteration.
112.
How is a REPEAT loop correctly formatted in pseudocode?
a)
REPEAT ... UNTIL <condition>
b)
REPEAT ... WHILE <condition>
c)
DO ... UNTIL <condition>
d)
DO ... WHILE <condition>
113.
Which of the following pseudocode loops checks its condition after each iteration?
a)
FOR
b)
WHILE
c)
REPEAT UNTIL
d)
DO WHILE
114.
In pseudocode, when would you use a WHILE loop instead of a REPEAT loop?
a)
When you want the loop to execute at least once regardless of the condition
b)
When you want to check the condition before executing any statements
c)
When you have a fixed number of iterations
d)
When you want to exit the loop as soon as the condition becomes FALSE
115.

In a REPEAT loop, the loop terminates if the condition evaluates to (a)   .

116.

A (a)   loop checks its condition at the beginning of each iteration.

117.

The REPEAT (a)   loop ensures that the statements inside it are executed at least once.

118.

In pseudocode, a loop that runs as long as a condition is TRUE is started with the keyword (a)   .

119.

A REPEAT loop in pseudocode is closed with the keyword (a)   followed by a condition.