Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 10: Recursion
Start Practice TestPractice Test
About Exam
medium Solved by 2 students

Recursive Method Return Value

Mark
< Prev
Next >

Consider the following recursive method.

public static int papaya(int x, int y) {
   if (x <= 1) {
      return y;
   } else {
      return papaya(x - 3, y + x);
   }
}

What value is returned as a result of the call papaya(10, 5)?

A

15

B

36

C

22

D

26

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|