Unit 5 - Two-Dimensional Arrays
Quiz
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Hard
Terresa Uzzle
Used 8+ times
FREE Resource
Enhance your content in a minute
19 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the code to the left.
What is printed out as a result of executing this code?
H
L
M
N
ArrayIndexOutOfBounds
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following code segment, where letters is a two-dimensional (2D) array that contains possible letters. The code segment is intended to print "PIG".
String[][] letters = { {"A", "B", "C", "D"},
{"E", "F", "G", "H"},
{"I", "J", "K", "L"},
{"M", "N", "O", "P"}};
System.out.println( /* missing code */ );
Which of the following could replace /* missing code */ so that the code segment works as intended?
letters[4][4] + letters[3][1] + letters[2][3]
letters[3][3] + letters[2][0] + letters[1][2]
letters[4][3] + letters[3][0] + letters[2][2]
letters[3][3] + letters[0][2] + letters[2][1]
letters[4][4] + letters[1][3] + letters[3][2]
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following two-dimensional array words.
String[][] words = { {"about", "actor", "admit", "agile"},
{"badge", "basic", "berry", "bingo"},
{"cacti", "cedar", "chair", "close"}};
What is the fifth element visited when row-major traversal is performed on words?
about
agile
badge
basic
cedar
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the Code segment to the left:
What is printed when num has the value 5?
4 1 3
5 6 8
6 7 9
8 5 7
9 6 8
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the Code segment to the left:
What is printed when num has the value 5?
4 1 3
5 6 8
6 7 9
8 5 7
9 6 8
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the following two-dimensional array words.
String[][] words = { {"about", "actor", "admit", "agile"},
{"badge", "basic", "berry", "bingo"},
{"cacti", "cedar", "chair", "close"}};
What is the fifth element visited when column-major traversal is performed on words?
about
agile
badge
basic
cedar
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider the code to the left:
Which of the following is the reason why an exception is thrown when the code is executed?
The row index is out of range because the for loop on line 5 iterates one time too many.
The column index is out of range because the for loop on line 6 iterates one time too many.
The column index is out of range because the indexes are in the wrong order.
The row index is out of range because the indexes are in the wrong order.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
15 questions
Pretest Aplikasi Pengolah Angka
Quiz
•
10th Grade
15 questions
Coding Quiz
Quiz
•
6th - 10th Grade
20 questions
2.3.1 Graph Traversal & Path Finding Algorithms
Quiz
•
12th Grade - University
15 questions
Problem Solving : Design Solution
Quiz
•
12th Grade
14 questions
Intro to Robotics
Quiz
•
9th Grade
14 questions
4th quarter 2nd summative
Quiz
•
10th Grade
17 questions
Security and Ethics
Quiz
•
9th - 12th Grade
21 questions
Computer System
Quiz
•
9th - 11th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
