What return statement may be used in p()?
AP CS A Unit 6 Exam PRACTICE

Quiz
•
Computers
•
9th - 12th Grade
•
Hard
Scott Chamberlain
Used 3+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
return 1;
return {1, 2, 3};
return int[]{1, 2, 3};
return new int[3];
return true;
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What does the following method do?
Returns a count of the number of elements in the array.
Returns the sum of the values in the array.
Returns a count of the number of times x appears in the array.
Returns the average of the values in the array.
Returns a count of the number of positive elements in the array
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following instance variable and method.
Which of the following replacements for /* missing code */ correctly implements the method printEvenIndices()?
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Assume the following method has been defined.
What is output by the following code?
String[] b = {"aardvark", "banana", "cougar", "daikon", "elephant", "fog", "get"};
System.out.println(mystery(b, 5));
0
2
3
4
5
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
When you pass an array to a method, the method receives _______.
a copy of the array
a copy of the first element
a copy of the reference to the first element
a copy of the reference to the array
the length of the array
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What does the following algorithm do?
Adds 1 to every value in the array.
Doubles all the values in the array.
Changes all the values in the array to even numbers.
Tests if the elements in the array are even or odd.
Doubles every other value in the array.
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Consider the following method.
What is printed when the code above is executed?
pro
pprpro
pprogrpro
prprograprog
programprogramprogram
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
Python Arrays Quiz P7

Quiz
•
11th Grade
20 questions
Abstract Data Types

Quiz
•
12th Grade
20 questions
Java Arrays

Quiz
•
9th - 12th Grade
20 questions
APCSA Arrays

Quiz
•
9th - 12th Grade
20 questions
Array

Quiz
•
12th Grade
17 questions
Arrays recap

Quiz
•
9th Grade - University
15 questions
Basic Data Structures - Intro to CS

Quiz
•
12th Grade
20 questions
Arrays in Java

Quiz
•
9th - 12th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University