?

AP® Computer Science A

Free Version

Upgrade subject to access all content

Moderate

Recursion with Multiple Parameters

APCSA-BIUZVB

Consider the following method:

public int mystery(int x, int y)
{
 if (x >= 100 || y <= 0)
    return 7;
 else
    return mystery(x + 10, y - 3) + 1;
}

What is returned as a result of the call mystery(50, 15)?

A

1

B

5

C

7

D

12

E

Nothing is returned due to infinite recursion.