Topic 6.1 Video 2

Quiz
•
Computers
•
11th Grade
•
Medium
Myra Deister
Used 3+ times
FREE Resource
6 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
I have viewed the video at https://apclassroom.collegeboard.org/d/3fdsi6azw2?sui=8,6
from start to finish
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following method which is intended to return the position of find within the String referenced at the middle index of arr. You may assume that the length of the arr is odd.
public static int findInMiddle (String [] arr, String find)
{
return /*missing code*/;
}
Which of the following could replace /*missing code*/ to complete the method as specified?
arr[ ].indexOf(find)
arr.indexOf(find)
arr[arr.length/2+1].indexOf(find)
arr[arr.length].indexOf(find)
arr[arr.length/2].indexOf(find)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the method on the left.
The mystery method is called from another method in the same class:
int[ ] list = {3, 7, 2, 9, 8};
int result = mystery(list);
What is stored in result after executing the above code?
2.5
4
8
11
11.5
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the segment of code to the left:
Why does the code cause a compile error?
Since grades is an array of type double, it cannot be used to store int values of 50, 70 and 89.
Since grades is created with an initializer list, the values of the elements of grades cannot be changed.
Elements of arrays cannot be updated based on the current element value, i.e., the += operator cannot be used with array elements.
The grades array contains three elements with indices 0, 1, and 2 therefore grades[3] causes an ArrayIndexOutOfBoundsException to be thrown
The code does not cause a compile error.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the method to the left.
Which of the following, when occurring in another method in the same class as mystery, would display the value true?
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the code segment to the left.
What is printed as a result of executing the code segment?
0
8
18
32
ArrayIndexOutOfBoundsException
Similar Resources on Wayground
11 questions
CodeHS 5.3 Using Arrays

Quiz
•
9th - 12th Grade
9 questions
CodeHS Unit 7 Review

Quiz
•
9th - 12th Grade
9 questions
Sorting Questions

Quiz
•
11th Grade
8 questions
J277 - 2.2 - Use of Arrays up to 2D

Quiz
•
10th Grade - University
10 questions
Global and local variables

Quiz
•
10th - 12th Grade
10 questions
apcsa-1D array

Quiz
•
11th Grade
11 questions
Translators

Quiz
•
11th Grade
10 questions
Information Processing - File Organization/Access

Quiz
•
10th - 11th Grade
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade