nacirfabeauty7418 nacirfabeauty7418
  • 02-06-2022
  • Computers and Technology
contestada

Consider the following method: public int mystery(int n) { if(n > 6) { return 1 mystery(n - 1); } return n % 3; } What is the value of mystery(10)

Respuesta :

rekhasmileforever
rekhasmileforever rekhasmileforever
  • 15-06-2022

Answer:

Ans1--- The output is 9 Explanation--- mystery(5)=mystery(4)+2 mystery(4)=mystery(3)+2 mystery(3)=mystery(2)+2 mystery(2)=2+1=3

Answer Link

Otras preguntas

Is STM semantically or acoustically encoded??
A bottle rocket that was made in science class had a trajectory path that followed the quadratic equation y=-x^2+4x+6. What is the turning point of the rocket's
Which of the following molecules has polar bonds but is a nonpolar molecule? a. H₂ b. H₂O c. NH₃ d. NaCl e. CO₂ Can anyone explain this one?
Which of the following is equivalent to 3a + 4b – (–6a – 3b) ? A. 16ab B. –3a + b C. –3a + 7b D. 9a + b E. 9a + 7b
what are some reasons for limiting authority
How can b^2+9b+14 be re-written?1) (b+7) (b-7)2) (b-7) (b-2)3) (b+7) (b-2)4) (b+7) (b+2)
how do i round 3,176 to the nearest thousand
1,352 pounds is what fraction short of a ton? A) 169/250             B) 77/100               C)13/20             D140/223
Identify the turning point of the function f(x)=x^2-2x+8 by writing its equation in vertex form. Show work
Is STM semantically or acoustically encoded??