| preferred AP College board partner for AP classes
AP Computer Science A/Unit 10: Recursion
Start Practice TestPractice Test
About Exam
medium Solved by 4 students
Recursive Method Return Value
< 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

36

B

26

C

22

D

15

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