Recursion Flashcard

Recursion Flashcard

Assessment

Flashcard

Computers

9th - 12th Grade

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

10 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following can be used to replace /* missing code */ so that the call bark(5) will cause "woof" to be printed five times? Options: bark(num - 5);, bark(num - 1);, bark(num);, bark(num + 1);, bark(num + 5);

Back

bark(num - 1);

2.

FLASHCARD QUESTION

Front

What value is returned by the method call calcMethod(16)?

Media Image

Back

41

3.

FLASHCARD QUESTION

Front

What is printed as a result of executing the following statement?
System.out.println(goAgain("today", 1));

Media Image

Back

todayodayay

4.

FLASHCARD QUESTION

Front

What value is returned as a result of the call mystery(9) ?

Media Image

Back

25

5.

FLASHCARD QUESTION

Front

What value is returned as a result of the call mystery(2, 3)?

Media Image

Back

No value is returned because mystery throws an ArrayIndexOutOfBoundsException.

6.

FLASHCARD QUESTION

Front

Which of the following is printed as a result of the call  mystery(123456) ?

Media Image

Back

123456

7.

FLASHCARD QUESTION

Front

What is printed as a result of executing the following code segment?
int[] array = {6, 8, 7, 9, 5};
mystery(array, 0);

Media Image

Back

59786

Create a free account and access millions of resources

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?