AAn ordered, static set of elements in a fixed-size memory location
BAn unordered collection of elements that can change size dynamically
CA single variable that stores multiple data types
DA data structure that can only store characters
2.In CIE pseudocode, what is the starting index of an array?
Easy
A0
B1
CDepends on the programming language
DThe index is always specified by the programmer
3.Which of the following correctly declares a 1D array in CIE pseudocode?
Easy
ADECLARE scores: ARRAY[1:5] OF INTEGER
BDECLARE scores: ARRAY[0:4] OF INTEGER
Cscores = [1,2,3,4,5]
DARRAY scores[5]
4.What does the following CIE pseudocode output?
DECLARE MyArray : ARRAY[1:3] OF INTEGER
MyArray[1] ← 5
MyArray[2] ← 10
MyArray[3] ← 15
OUTPUT MyArray[2]
Easy
A5
B10
C15
DError
5.A 2D array is declared as DECLARE table: ARRAY[1:4, 1:3] OF INTEGER. How many elements does it contain?
Easy
A7
B12
C4
D3
6.In CIE pseudocode, what is the correct way to assign the value 'Red' to the fourth element of a 1D array called colours?
Easy
Acolours[4] ← 'Red'
Bcolours[3] ← 'Red'
Ccolours[4] = 'Red'
Dcolours[0] ← 'Red'
7.Consider the following 2D array in CIE pseudocode:
DECLARE grid : ARRAY[1:2, 1:2] OF INTEGER
grid[1,1] ← 1
grid[1,2] ← 2
grid[2,1] ← 3
grid[2,2] ← 4
What is the value of grid[2,1]?
Easy
A1
B2
C3
D4
8.In CIE pseudocode, which loop structure is typically used to iterate through all elements of a 1D array?
Easy
AFOR...NEXT loop
BWHILE loop
CREPEAT...UNTIL loop
DIF...THEN statement
もっと問題
9.Given the following CIE pseudocode, what is the output?
DECLARE arr : ARRAY[1:4] OF INTEGER
arr[1] ← 2
arr[2] ← 4
arr[3] ← 6
arr[4] ← 8
DECLARE i : INTEGER
FOR i ← 1 TO 4
arr[i] ← arr[i] * 2
NEXT i
OUTPUT arr[3]
Medium
A6
B8
C12
D16
10.A 2D array is used to store the names and scores of 5 players. In CIE pseudocode, which declaration is correct?
Medium
ADECLARE players : ARRAY[1:5, 1:2] OF STRING
BDECLARE players : ARRAY[1:2, 1:5] OF STRING
CDECLARE players : ARRAY[1:5] OF STRING
DDECLARE players : ARRAY[1:5, 1:2] OF INTEGER
11.In CIE pseudocode, what is the output of the following code?
DECLARE matrix : ARRAY[1:2, 1:3] OF INTEGER
matrix[1,1] ← 1
matrix[1,2] ← 2
matrix[1,3] ← 3
matrix[2,1] ← 4
matrix[2,2] ← 5
matrix[2,3] ← 6
OUTPUT matrix[2,2]
Easy
A2
B3
C5
D6
12.Which of the following statements about arrays is FALSE?
Medium
AAn array can only store one data type
BIn Python, array indexes start at 0
CA 2D array can be visualised as a table with rows and columns
DIn CIE pseudocode, the length of an array can be obtained using the len function
13.A program stores the temperatures recorded each day for a week in an array called 'temps'. The array is declared as:
DECLARE temps : ARRAY[1:7] OF REAL
Which of the following correctly assigns the temperature 23.5 to the third day?
Easy
Atemps[3] ← 23.5
Btemps[2] ← 23.5
Ctemps[4] ← 23.5
Dtemps[0] ← 23.5
14.A 2D array 'grid' is declared as:
DECLARE grid : ARRAY[1:3, 1:4] OF INTEGER
How many elements does this array contain?
Easy
A12
B7
C16
D9
15.Consider the following CIE pseudocode:
DECLARE scores : ARRAY[1:5] OF INTEGER
scores[1] ← 10
scores[2] ← 20
scores[3] ← 30
scores[4] ← 40
scores[5] ← 50
DECLARE i : INTEGER
DECLARE total : INTEGER
total ← 0
FOR i ← 1 TO 5
IF scores[i] MOD 3 = 0 THEN
total ← total + scores[i]
ENDIF
NEXT i
OUTPUT total
What is the output?
Medium
A30
B10
C20
D60
16.A teacher stores the test scores of 30 students in a 1D array called 'testScores'. Which of the following pseudocode snippets correctly calculates the average score?
Medium
Atotal ← 0
FOR i ← 1 TO 30
total ← total + testScores[i]
NEXT i
average ← total / 30
Btotal ← 0
FOR i ← 0 TO 29
total ← total + testScores[i]
NEXT i
average ← total / 30
Ctotal ← 0
FOR i ← 1 TO 30
total ← total + testScores[i]
NEXT i
average ← total / 29
Dtotal ← 0
FOR i ← 1 TO 30
total ← total + testScores[1]
NEXT i
average ← total / 30
17.A 2D array 'matrix' is declared as:
DECLARE matrix : ARRAY[1:2, 1:3] OF INTEGER
matrix[1,1] ← 1
matrix[1,2] ← 2
matrix[1,3] ← 3
matrix[2,1] ← 4
matrix[2,2] ← 5
matrix[2,3] ← 6
What is the value of matrix[2,1] + matrix[1,2]?
Medium
A6
B3
C5
D7
18.Which of the following correctly declares a 2D array in CIE pseudocode that can store the names and ages of 10 people?
Medium
ADECLARE people : ARRAY[1:10, 1:2] OF STRING
BDECLARE people : ARRAY[1:2, 1:10] OF STRING
CDECLARE people : ARRAY[1:10, 1:2] OF INTEGER
DDECLARE people : ARRAY[0:9, 0:1] OF STRING
19.The following table shows the number of books read by three students over four weeks, stored in a 2D array 'books'.
Week1 Week2 Week3 Week4
Student1 3 5 2 4
Student2 4 6 3 5
Student3 2 4 1 3
In CIE pseudocode, if the array is declared as DECLARE books : ARRAY[1:3, 1:4] OF INTEGER, which expression gives the number of books read by Student2 in Week3?
Medium
Abooks[2,3]
Bbooks[3,2]
Cbooks[1,2]
Dbooks[2,4]
20.A program uses a 1D array 'numbers' of size 10. Which of the following pseudocode snippets correctly finds the largest value in the array?
Medium
Amax ← numbers[1]
FOR i ← 2 TO 10
IF numbers[i] > max THEN
max ← numbers[i]
ENDIF
NEXT i
Bmax ← 0
FOR i ← 1 TO 10
IF numbers[i] > max THEN
max ← numbers[i]
ENDIF
NEXT i
Cmax ← numbers[1]
FOR i ← 1 TO 10
IF numbers[i] > max THEN
max ← numbers[i]
ENDIF
NEXT i
Dmax ← numbers[10]
FOR i ← 1 TO 9
IF numbers[i] > max THEN
max ← numbers[i]
ENDIF
NEXT i
21.In CIE pseudocode, what is the output of the following code?
DECLARE arr : ARRAY[1:4] OF INTEGER
arr[1] ← 7
arr[2] ← 3
arr[3] ← 9
arr[4] ← 1
OUTPUT arr[2] + arr[4]
Easy
A4
B10
C12
D8
22.A 2D array 'sales' stores the sales figures for 4 products over 6 months. Which of the following loops correctly calculates the total sales for all products over all months?
Medium
Atotal ← 0
FOR row ← 1 TO 4
FOR col ← 1 TO 6
total ← total + sales[row, col]
NEXT col
NEXT row
Btotal ← 0
FOR col ← 1 TO 6
FOR row ← 1 TO 4
total ← total + sales[col, row]
NEXT row
NEXT col
Ctotal ← 0
FOR row ← 1 TO 6
FOR col ← 1 TO 4
total ← total + sales[row, col]
NEXT col
NEXT row
Dtotal ← 0
FOR row ← 1 TO 4
FOR col ← 1 TO 6
total ← total + sales[col, row]
NEXT col
NEXT row
23.Consider the following CIE pseudocode:
DECLARE data : ARRAY[1:5] OF INTEGER
data[1] ← 2
data[2] ← 5
data[3] ← 8
data[4] ← 11
data[5] ← 14
DECLARE i : INTEGER
DECLARE result : INTEGER
result ← 0
FOR i ← 1 TO 5
IF data[i] MOD 2 = 1 THEN
result ← result + 1
ENDIF
NEXT i
OUTPUT result
What is the output?
Medium
A2
B3
C5
D1
24.A program uses a 2D array 'board' to represent a tic-tac-toe grid. The array is declared as:
DECLARE board : ARRAY[1:3, 1:3] OF CHAR
Initially, all elements are set to ' '. Which of the following correctly sets the centre cell to 'X'?
Easy
Aboard[2,2] ← 'X'
Bboard[1,1] ← 'X'
Cboard[3,3] ← 'X'
Dboard[2,3] ← 'X'
25.In CIE pseudocode, what is the index of the first element in a 1D array?
Easy
A0
B1
C-1
DIt depends on the array
26.Which of the following correctly declares a 1D array in CIE pseudocode to store the names of 10 students?
Easy
ADECLARE names : ARRAY[1:10] OF STRING
BDECLARE names : ARRAY[0:9] OF STRING
CDECLARE names : ARRAY[10] OF STRING
DDECLARE names : ARRAY[1..10] OF STRING
27.What is the output of the following CIE pseudocode?
DECLARE MyArray : ARRAY[1:3] OF INTEGER
MyArray[1] ← 5
MyArray[2] ← 10
MyArray[3] ← 15
OUTPUT MyArray[2]
Easy
A5
B10
C15
D2
28.In CIE pseudocode, which loop structure is typically used to iterate through all elements of a 1D array of size 5?
Easy
AFOR i ← 1 TO 5
BFOR i ← 0 TO 4
CWHILE i < 5
DREPEAT...UNTIL i = 5
29.In CIE pseudocode, what is the output of the following code?
DECLARE matrix : ARRAY[1:2, 1:3] OF INTEGER
matrix[1,1] ← 1
matrix[1,2] ← 2
matrix[1,3] ← 3
matrix[2,1] ← 4
matrix[2,2] ← 5
matrix[2,3] ← 6
OUTPUT matrix[1,2] + matrix[2,1]
Medium
A3
B5
C6
D7
30.A program stores the temperatures recorded each day for a week in an array called 'temps'. The array is declared as:
DECLARE temps : ARRAY[1:7] OF REAL
Which pseudocode snippet correctly calculates the average temperature?
Medium
Atotal ← 0
FOR i ← 1 TO 7
total ← total + temps[i]
NEXT i
average ← total / 7
Btotal ← 0
FOR i ← 0 TO 6
total ← total + temps[i]
NEXT i
average ← total / 7
Ctotal ← 0
FOR i ← 1 TO 7
total ← total + temps[i]
NEXT i
average ← total / 5
Dtotal ← 0
FOR i ← 1 TO 7
total ← temps[i]
NEXT i
average ← total / 7
31.In CIE pseudocode, what is the starting index of a 1D array?
Easy
A0
B1
CIt depends on the data type
DThe programmer can choose
32.Given the following CIE pseudocode, what is the output?
DECLARE arr : ARRAY[1:4] OF INTEGER
arr[1] ← 2
arr[2] ← 4
arr[3] ← 6
arr[4] ← 8
DECLARE i : INTEGER
FOR i ← 1 TO 4
OUTPUT arr[i] * 2
NEXT i
Easy
A2 4 6 8
B4 8 12 16
C1 2 3 4
D8 6 4 2
33.In CIE pseudocode, what is the output of the following code?
DECLARE matrix : ARRAY[1:2, 1:3] OF INTEGER
matrix[1,1] ← 1
matrix[1,2] ← 2
matrix[1,3] ← 3
matrix[2,1] ← 4
matrix[2,2] ← 5
matrix[2,3] ← 6
OUTPUT matrix[2,2] + matrix[1,3]
Medium
A8
B7
C9
D10
34.A program stores the temperatures recorded each day for a week in an array called 'temps'. The array is declared as:
DECLARE temps : ARRAY[1:7] OF REAL
Which of the following correctly outputs the temperature on the third day?
Easy
AOUTPUT temps[3]
BOUTPUT temps[2]
COUTPUT temps[1]
DOUTPUT temps[4]
35.A 2D array 'temps' stores the temperature readings for 7 days (rows 1–7) at 3 different times each day (columns 1–3). Which expression gives the temperature reading for day 4 at the second time of day?
Easy
Atemps[4,2]
Btemps[2,4]
Ctemps[3,4]
Dtemps[4,3]
36.A program declares a 2D array as: DECLARE grid : ARRAY[1:4, 1:5] OF INTEGER. The program then sets all elements to 0. How many assignment statements are needed to initialise every element?
Medium
A20
B9
C4
D5
37.Consider the following CIE pseudocode:
DECLARE arr : ARRAY[1:5] OF INTEGER
arr[1] ← 3
arr[2] ← 7
arr[3] ← 2
arr[4] ← 9
arr[5] ← 5
DECLARE i, total : INTEGER
total ← 0
FOR i ← 1 TO 5
IF arr[i] > 4 THEN
total ← total + arr[i]
ENDIF
NEXT i
OUTPUT total
What is the output?
Medium
A21
B16
C19
D26
38.A teacher stores the test scores of 30 students in a 1D array called 'scores'. Which of the following correctly declares this array in CIE pseudocode?
Easy
ADECLARE scores : ARRAY[1:30] OF INTEGER
BDECLARE scores : ARRAY[0:29] OF INTEGER
CDECLARE scores : ARRAY[1:30] OF REAL
DDECLARE scores : ARRAY[30] OF INTEGER
39.The following table shows the sales of three products over four weeks stored in a 2D array 'sales'.
Week1 Week2 Week3 Week4
Product1 120 150 110 130
Product2 200 180 210 190
Product3 90 110 95 105
Which pseudocode correctly calculates the total sales of all products over all weeks?
Medium
Atotal ← 0
FOR row ← 1 TO 3
FOR col ← 1 TO 4
total ← total + sales[row, col]
NEXT col
NEXT row
Btotal ← 0
FOR col ← 1 TO 4
FOR row ← 1 TO 3
total ← total + sales[col, row]
NEXT row
NEXT col
Ctotal ← 0
FOR row ← 1 TO 4
FOR col ← 1 TO 3
total ← total + sales[row, col]
NEXT col
NEXT row
Dtotal ← 0
FOR row ← 1 TO 3
FOR col ← 1 TO 4
total ← total + sales[col, row]
NEXT col
NEXT row
40.In CIE pseudocode, what is the output of the following code?
DECLARE arr : ARRAY[1:4] OF INTEGER
arr[1] ← 5
arr[2] ← 10
arr[3] ← 15
arr[4] ← 20
arr[2] ← arr[1] + arr[3]
OUTPUT arr[2]
Medium
A20
B15
C25
D10
41.An array can store multiple different data types at the same time.
Easy
True or false?
42.Which of the following correctly declares a 2D array in CIE pseudocode to store the names and ages of 10 people?
Easy
ADECLARE people : ARRAY[1:10, 1:2] OF STRING
BDECLARE people : ARRAY[1:2, 1:10] OF STRING
CDECLARE people : ARRAY[1:10, 1:2] OF INTEGER
DDECLARE people : ARRAY[1:10] OF STRING
43.Match each pseudocode operation with its correct description.
Medium
DECLARE scores : ARRAY[1:5] OF INTEGER
scores[3] ← 10
OUTPUT scores[2]
FOR i ← 1 TO 5
Declaration
Assignment
Output
Iteration
44.Consider the following CIE pseudocode:
DECLARE arr : ARRAY[1:4] OF INTEGER
arr[1] ← 5
arr[2] ← 10
arr[3] ← 15
arr[4] ← 20
arr[2] ← arr[1]
OUTPUT arr[2]
What is the output?
Easy
A5
B10
C15
D20
45.In CIE pseudocode, the length of an array can be determined using the built-in LEN function.
Easy
True or false?
46.Arrange the following steps in the correct order to iterate through all elements of a 2D array in CIE pseudocode:
Medium
OUTPUT Array2D[Row, Col]
FOR Col ← 1 TO 3
NEXT Col
FOR Row ← 1 TO 3
NEXT Row
47.Which of the following are true about arrays in CIE pseudocode? (Select all that apply)
Medium
AArrays are zero-indexed.
BArrays can store only one data type.
CArrays are dynamic in size.
DA 2D array can be visualised as a table.
EThe DECLARE statement is used to create an array.
48.Match each array operation in CIE pseudocode with its correct description.
Medium
DECLARE scores : ARRAY[1:5] OF INTEGER
scores[3] ← 10
OUTPUT scores[2]
FOR i ← 1 TO 5
Declares a 1D array of 5 integers
Assigns value 10 to the third element
Outputs the second element
Iterates through all elements
49.Which of the following are true about 2D arrays in CIE pseudocode? (Select all that apply)
Medium
AThey can be visualised as a table with rows and columns.
BThe first index always represents the column.
CA nested FOR loop is used to iterate through all elements.
DThey can store multiple data types in different elements.
EThey are declared using the keyword ARRAY with two index ranges.
50.Arrange the following steps in the correct order to declare and initialise a 2D array called 'grid' with 2 rows and 3 columns in CIE pseudocode, then output the element at row 2, column 1.
Medium
OUTPUT grid[2,1]
grid[1,1] ← 1
DECLARE grid : ARRAY[1:2, 1:3] OF INTEGER
grid[2,1] ← 4
grid[1,2] ← 2
51.Complete the sentence: In CIE pseudocode, a 1D array is declared using the keyword DECLARE followed by the identifier, a colon, the keyword ARRAY, the index range in square brackets, and the keyword ___.
Easy
In CIE pseudocode, a 1D array is declared using the keyword DECLARE followed by the identifier, a colon, the keyword ARRAY, the index range in square brackets, and the keyword ____.
52.What is the term for an array that can be visualised as a table with rows and columns?
Easy
53.Complete the following CIE pseudocode to declare a 2D array called 'grid' with 4 rows and 5 columns of integers:
Easy
DECLARE grid : ARRAY[1:____, 1:____] OF INTEGER
54.How many elements does a 2D array declared as DECLARE matrix : ARRAY[1:3, 1:4] OF INTEGER contain?
Easy
55.Consider the following CIE pseudocode. What value is output?
Medium
56.In CIE pseudocode, write a line of code to declare a 2D array called 'temps' with 7 rows and 3 columns to store real numbers.
Medium
57.Complete the following CIE pseudocode that declares a 2D array 'marks' for 30 students (rows) each having 4 test scores (columns) of type integer, then assigns the value 85 to the third test of the first student.
Medium
DECLARE marks : ARRAY[1:30, 1:4] OF INTEGER
____[____, ____] ← 85
58.How many elements does a 2D array declared as DECLARE matrix : ARRAY[1:3, 1:4] OF INTEGER contain?
Easy
A14
B13
C11
D12
59.Consider the following CIE pseudocode. What value is output?