
Quiz on Arrays
Quiz
•
Computers
•
12th Grade
•
Hard
Donna Callender
Used 1+ times
FREE Resource
17 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
Complete this sentence: Arrays are ................. data structures.
Answer explanation
Arrays are linear because their elements are arranged in a sequential manner. They are homogenous as they store elements of the same type, and static since their size is fixed upon creation.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is TRUE about arrays?
Arrays store data in a certain order
All data in an array are of the same data type
Each element has a corresponding index value
All of the above
Answer explanation
All statements about arrays are true: they store data in a specific order, contain elements of the same data type, and each element has a corresponding index value. Therefore, the correct answer is 'All of the above'.
3.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
Complete this sentence: ................. module is initiated from Python library to work with arrays.
Answer explanation
The correct choice is 'array' because the Python library provides the 'array' module specifically designed to work with arrays, making it the most appropriate completion for the sentence.
4.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
Complete this sentence: Index of an array starts with ..................
Answer explanation
The index of an array in most programming languages, such as C, C++, and Python, starts at 0. This means the first element of the array is accessed with index 0, making '0' the correct answer.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
An array number_of_students represents 10 students’ marks. Which of the following represents this array declaration?
number_of_students=array('i', range(10))
number_of_students=array.array('i', range(1,10))
number_of_students=array.array('i', range(10))
None of the above
Answer explanation
The correct choice is 'number_of_students=array.array('i', range(10))' because it properly declares an array of integers with 10 elements, using the 'array' module in Python. The other options either use incorrect syntax or range.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A program prompts the user to input values to an array. What programming structure is required for this?
Case structures
If... else....
Iteration
None of the above
Answer explanation
Iteration is required to repeatedly prompt the user for input values to fill an array. This allows the program to collect multiple inputs until a specified condition is met, making it the correct choice.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
An array student mark consists of data: [90,85,70,75,80]. What is the output of print(student mark[3])?
70
75
80
Answer explanation
In Python, array indexing starts at 0. Therefore, student mark[3] refers to the fourth element in the array, which is 75. Thus, the output of print(student mark[3]) is 75.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Java Arrays
Quiz
•
9th - 12th Grade
20 questions
Abstract Data Types
Quiz
•
12th Grade
20 questions
APCSA Arrays
Quiz
•
9th - 12th Grade
16 questions
Introduction to Programming (Ch2)
Quiz
•
9th - 12th Grade
15 questions
Area With Arrays
Quiz
•
10th - 12th Grade
20 questions
Latihan Sturktur Data
Quiz
•
12th Grade
20 questions
CSP Unit 6: Algorithms
Quiz
•
9th - 12th Grade
20 questions
Data handling using pandas and Data visualization
Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games
Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines
Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22
Lesson
•
9th - 12th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
20 questions
US Constitution Quiz
Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
