
APCSA MCQPacket Unit 7-10
Flashcard
•
Computers
•
11th Grade
•
Practice Problem
•
Hard
Wayground Content
FREE Resource
Student preview

34 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Consider the following code segment. What is printed as a result of executing the code segment? Options: , , , , Nothing is printed because the first print statement will cause an error.
Back
2.
FLASHCARD QUESTION
Front
Refer to the static method removeNegs shown below. For which of the following lists will the method not work as intended? 6 -1 -2 5, -1 2 -3 4, 2 4 6 8, -3, 1 2 3 -8
Back
6 -1 -2 5
3.
FLASHCARD QUESTION
Front
Consider a sorted array arr of n elements, where n is large and n is even. Under which conditions will a linear search of arr be faster than a binary search? I. The target is not in the list. II. The target is in the first position of the list. III. The target is in arr [l + n/2]
Back
II only
4.
FLASHCARD QUESTION
Front
Let list be an ArrayList<String> containing only these elements: “Alex”, “Emma”, “John”, “Luis”. Which of the following statements will cause an error to occur? I. list.set(2, “6”); II. list.add(4, “Steven”); III. String s = list.get(4);
Back
III only
5.
FLASHCARD QUESTION
Front
Consider a Monster class that has a default constructor. Suppose a list ArrayList<Monster> minions is initialized. Which of the following will not cause an IndexOutOfBoundsException to be thrown?
Options:
for(int i = 0; i <= minions.size(); i++) minions.set(i, new Monster());
minions.add(minions.size(), new Monster());
Monster m = minions.get(minions.size());
Monster m = minions.remove(minions.size());
minions.add(-1, new Monster());
Back
minions.add(minions.size(), new Monster());
6.
FLASHCARD QUESTION
Front
A sorted list of 200 integers is to be searched to determine whether the value of 150 is in the list. What is the most efficient sorting algorithm to use in this case and what is the maximum number of elements that would be examined?
Back
Binary Search, 8 times
7.
FLASHCARD QUESTION
Front
What element will be contained in nums[2] after executing the shuffle algorithm on the array nums = 8, 7, 6, 5, 4 with rand values 3, 2, 0, 0?
Back
8
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
29 questions
Chemistry Concepts
Flashcard
•
11th Grade
30 questions
Vocabulaire de la Maison
Flashcard
•
KG
30 questions
Key Features of Prepositions
Flashcard
•
11th Grade
23 questions
Cereal Grains and Gluten Structure
Flashcard
•
KG
31 questions
J277 Architecture and Factors that effect performance
Flashcard
•
10th Grade
30 questions
Tests for Anions, Cations and Gases
Flashcard
•
10th - 11th Grade
26 questions
Unit 3 Flashcards
Flashcard
•
9th - 12th Grade
33 questions
AQA Physics Paper 1- Electricity
Flashcard
•
9th - 11th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
20 questions
christmas songs
Quiz
•
KG - University