WorksheetsString and Math Methods AP CSA
Total questions: 10
Worksheet time: 21mins
ABCD
BCDE
BCEF
BCDEF
ABCDEF
3
4
5
6
7
Consider the following code segment.
What is printed when the code segment is executed?
comp
c o m p
comp com co c
comp omp mp p
comp comp comp comp
Consider the following code segment.
What is the value of num when the code segment is executed?
3
4
5
6
7
Use the image for the question.
Which of the following statements assigns a random integer between 1 and 10, inclusive, to rn ?
Consider the following code segment, which is intended to assign to num a random integer value between min and max, inclusive. Assume that min and max are integer variables and that the value of max is greater than the value of min.
Which of the following could be used to replace /* missing code */ so that the code segment works as intended?
Consider the following code
What is printed as a result of exectuting the code segment?
operation goes well
15
ation goes well
7
the operation goes well
Consider the following code segment.
What is printed as a result of executing the code segment?
bye
3
dbye
2
odbye
Consider the following code segment
What is output to the console when this code segment is executed?
12.0
6.0
-0.7
-6.0
-12.0
