AP CSA Unit 4 Review

AP CSA Unit 4 Review

Assessment

Flashcard

Computers

11th Grade

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

40 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What will happen to the output of the code segment? Options: The output of the code segment will be unchanged. The string "Fun" will be printed more times because the outer loop will execute more times. The string "Fun" will be printed more times because the inner loop will execute more times in each iteration of the outer loop. The string "Fun" will be printed fewer times because the outer loop will execute fewer times. The string "Fun" will be printed fewer times because the inner loop will execute fewer times in each iteration of the outer loop.

Media Image

Back

The string "Fun" will be printed more times because the outer loop will execute more times.

2.

FLASHCARD QUESTION

Front

Which of the following code segments could replace the while loop in the method digitSum without changing the value returned by the method? Options: I only, II only, III only, I and II, II and III

Media Image

Back

III only

3.

FLASHCARD QUESTION

Front

Which of the following best explains how the difference in the two loop headers affects the output? Options: The output of the code segments is the same because the loops in each code segment terminate when i is 10. The output of the code segments is the same because the loops in both code segments iterate 10 times. The output of the code segments is different because code segment I iterates from i = 0 to i = 9 and code segment II iterates from i = 1 to i = 10. The output of the code segments is different because code segment I iterates from i = 0 to i = 10 and code segment II iterates from i = 1 to i = 11. Neither code segment produces output because both loop conditions are initially false.

Media Image

Back

The output of the code segments is the same because the loops in both code segments iterate 10 times.

4.

FLASHCARD QUESTION

Front

Which of the following code segments will produce the same output as the code segment above?

Media Image

Back

Media Image

5.

FLASHCARD QUESTION

Front

What is the correct answer from the options: 100, 101, 160, 161, 321?

Media Image

Back

161

6.

FLASHCARD QUESTION

Front

What is the correct condition for the loop? Options: while (k < 3), while (k < 4), while (k < 5), while (k <= 4), while (k <= 5)

Media Image

Back

while (k < 4)

7.

FLASHCARD QUESTION

Front

How many times does the following method print a *?

Media Image

Back

6

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?