wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Arrays and Lists

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.
What is a data structure?
a)
A list of variables
b)
A list of variables and strings
c)
A facility that holds more than one value
2.
What is an array?
a)
A list of variables
b)
A list of strings
c)
A series of memory locations, each with the same name, that hold related data
3.
Why are arrays used?
a)
Arrays store multiple data values under one name, reducing the complexity of our program
b)
Arrays store more data than if we were using variables
c)
Arrays store more data than if we were using strings
4.
In an array, what is an element?
a)
The smallest number an array can hold
b)
The biggest number an array can hold
c)
An element is one value in an array
5.
How many elements would the array 'student_marks(10)' hold?
a)
Nine elements
b)
Ten elements
c)
Eleven elements
6.
In the array 'numbers(6, 10, 7, 12, 9, 2)', what is the value of element numbers(4)?
a)
Nine
b)
Twelve
c)
Two
7.
In the array 'colours("Purple", "Blue", "Red", "Green", "Yellow")', what is the value of the element colours(3)?
a)
Green
b)
Red
c)
Purple
8.
In the array 'names("John", "Ali", "Sarah")', what is the value of element names(2)?
a)
Ali
b)
Sarah
c)
John
9.
What is the difference between an array and a list?
a)
An array holds numbers, whereas a list holds strings
b)
An array can only hold data of the same data type, whereas lists can hold values of different data types
c)
An array holds both numbers and strings, whereas a list only holds numbers
10.
When creating the array 'scores(9)', what does the '9' in brackets represent?
a)
The number of elements the array can hold
b)
The largest number of digits an element can hold
c)
The largest number of characters an element can hold