wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

8.2 Arrays Cambridge IGCSE 0478

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the primary advantage of using an array in a program?

a)

It allows multiple values to be stored under a single variable name.

b)

It eliminates the need for loops.

c)

It prevents errors in a program.

d)

It improves execution speed for all operations.

2.

How does a one-dimensional (1D) array store data?

a)

As a list of values, each accessed using a single index.

b)

In a table format with rows and columns.

c)

As a linked list of separate memory locations.

d)

By assigning values dynamically without indexing.

3.

In a two-dimensional (2D) array, how many indices are needed to access a value?

a)

Two (one for the row and one for the column).

b)

One (similar to a 1D array).

c)

Three (one for each possible dimension).

d)

It depends on the programming language.

4.

What does the following pseudocode do?

a)

Stores the values [0, 2, 4, 6, 8] in myArray.

b)

Stores the values [1, 2, 3, 4, 5] in myArray.

c)

Stores only even numbers but does not assign them.

d)

Produces an error because i * 2 is not valid.

5.

How would you access the third element in an array named scores if arrays are zero-indexed?

a)

scores[2]

b)

scores[3]

c)

scores[1]

d)

scores[0]

6.

What is required when iterating over a 2D array?

a)

Nested loops (one for rows and one for columns).

b)

A single loop for all elements.

c)

A recursive function call.

d)

A predefined index table.

7.

If an array data[5] is declared in a zero-indexed language, how many elements can it store?

a)

5 elements

b)

4 elements

c)

6 elements

d)

It depends on the values stored.

8.

What happens if an index outside the array bounds is accessed?

a)

An error occurs (e.g., "Index Out of Bounds").

b)

The program automatically resizes the array.

c)

A default value is returned instead of an error.

d)

The value at the last valid index is returned.

9.

Which of the following is the correct way to store values in a 2D array in pseudocode?

a)

FOR i ← 0 TO 2 FOR j ← 0 TO 2

b)

FOR i ← 1 TO 3 FOR j ← 1 TO 3

c)

FOR i ← 0 TO 3 FOR j ← 0 TO 3

d)

FOR i ← 1 TO 2 FOR j ← 1 TO 2

10.

If arr is a 1D array with 10 elements, what is the last valid index in a zero-indexed system?

a)

9

b)

10

c)

8

d)

0