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

If you place a 29-foot ladder against the top of a 20-foot building, how many feet will the bottom of the ladder be from the bottom of the building?
Sunita carries out an experiment to investigate diffusion. She uses water and a food dye to find out how the volume of water used affects the time the dye takes
What is a benefit of the Name Manager feature?​
What do communist countries such as North Korea and the former USSR concentrate on manufacturing most?
Write -0.048 as a fraction In simplest form
Franklin Construction Company build a sidewalk around two sides of a new library, as shown in the figure. what is the area of the sidewalk.​please help
I don’t know what any of these are can someone plzzzz help me
Weaknesses of the articles of confederation
How did the reintroduction of wolves into Yellowstone park return the stability to the Yellowstone ecosystem
Cutting down forests changes the populations of more than trees. Imagine the organisms that lived in this forest. After the trees have been cut, fewer animals c