
APCSA unit 6
Authored by Thomas Wright
Computers
11th Grade
Used 11+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
26 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Which of the following arrays has a length of 5?
double[] arr = new double[6];
double[] arr = {3, 12, 52, 23, 14, 0};
double[] arr = new double[]{3, 12, 52, 23, 14, 0};
all of these
none of these
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements correctly initializes an array of integers with a size of 4?
int[] arr = new int[4];
int[] arr = {1, 2, 3};
int[] arr = new int[]{1, 2, 3, 4, 5};
none of these
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which option represents a correctly initialized string array containing exactly 3 elements?
String[] arr = new String[2];
String[] arr = {"Hello", "World", "!"};
String[] arr = new String[]{"Java"};
all of these
none of these
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you initialize a boolean array of size 5 with all elements set to true?
boolean[] arr = new boolean[5];
boolean[] arr = {true, true, true, true, true};
boolean[] arr = new boolean[]{true};
none of these
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following code is designed to return true if a target value is present in an array of integers.
Which of the following statements is true?
The code will not work correctly because the loop will not access each of the numbers correctly.
The code will not work correctly because it may return true too soon.
The code will not work correctly because the method may return false too soon.
The code will work as intended.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code do when executed?
It will produce an error because the conditional statement is not set up correctly.
It will count the number of times the value in the highTemp array exceeds the target value.
It will produce an ArrayIndexOutOfBoundsException
It will count the number of times that the value in the array is greater than the previous value in the array.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is valid? Assume that variable arr is an array of n integers and that the following is true:
arr[0] != arr[i] for all values of i from 1 through n - 1
The element arr[0] does not occur anywhere else in the array
arr has no duplicates
arr has duplicates
arr is sorted
arr is not sorted
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
22 questions
IT Essentials Ch 12 Review - Mobile, Linux, and MacOS
Quiz
•
9th Grade - Professio...
25 questions
Microsoft Word Unit 14 Test Review
Quiz
•
9th - 12th Grade
23 questions
Revision grade 11 term 3
Quiz
•
11th Grade
22 questions
11 CSC ATAR - Week 2-3 review
Quiz
•
11th Grade
22 questions
Functions in RobotC
Quiz
•
7th - 11th Grade
23 questions
Navigating Digital Information: Review of all Ten Videos
Quiz
•
9th Grade - University
21 questions
Stepford County Railway Quiz
Quiz
•
1st Grade - University
21 questions
G.K Quiz
Quiz
•
1st Grade - Professio...
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade