
AP CSA Unit 2 Test review
Quiz
•
Computers
•
11th Grade
•
Practice Problem
•
Medium
James Santiago
Used 3+ times
FREE Resource
Enhance your content in a minute
34 questions
Show all answers
1.
MATCH QUESTION
30 sec • 5 pts
(int) (Math.random() * 11 + 1)
Integer 0-10, inclusive
(int) (Math.random() * 20)
Integer 1-11, inclusive
(Math.random()*10)
Integer 0-99, inclusive
(int) (Math.random()*100)
Integer 0-19, inclusive
(int) (Math.random() * 11)
0.0 <= x < 10.0
2.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Consider the following code segment.
What is printed when the code segment is executed?
2
5
-1
2
5
2
2
6
-1
3
6
-1
-1
-1
2
3.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
The code segment below is intended to randomly print one of the values 2, 4, 6, or 8 with equal probability.
Which of the following can be used to replace /* missing code */ so that the code segment works as intended?
Math.random() * 4 + 1
Math.random() * 8
(int) (Math.random() * 4)
(int) (Math.random() * 4 + 1)
(int) (Math.random() * 8 + 1)
4.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
Consider the following code segment, which is intended to display 6.0.
Which of the following best describes the error, if any, in the code segment?
There are no errors and the code works as intended.
Either the numerator or the denominator of the fraction 1 / 2 should be cast as double.
The expression fact1 * fact 2 should be cast as double.
The expressions 1 / 2 and 3 * 4 should both be cast as double.
The variables fact1 and fact2 should both be declared as int.
5.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
String txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
What is the correct way to find the length of "txt" string?
int len = length(txt);
float len = txt.length();
int len = txt.length();
double len = length(txt);
6.
MULTIPLE CHOICE QUESTION
30 sec • 5 pts
System.out.println(1 + 2 + "3");
123
6
33
error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A standard way of visualizing the design of a program that displays class names, attributes, behaviors, and relationships to other classes is known as a(n):
Program Design Layout
Abstraction Model
UML Diagram
Class Hierarchy
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
37 questions
Administrasi Infrastruktur Jaringan
Quiz
•
11th Grade
30 questions
05_Block Breaker Videos 02-07 Worksheet
Quiz
•
9th - 12th Grade
35 questions
SCRATCH
Quiz
•
4th Grade - University
30 questions
Empowerment Technology
Quiz
•
11th Grade
30 questions
COP NSDA L3= 0005
Quiz
•
12th Grade
30 questions
IT security - 3
Quiz
•
9th Grade - University
31 questions
Quiz#8: Elements of Film Form
Quiz
•
University
30 questions
1.5 System Software
Quiz
•
9th - 11th Grade
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
