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

There were 75 rocks is Boxes A,B, and C. After moving 28 rocks fro Box A to B, 24 rocks from B to C, and 19 rocks from C to A,there was an equal number of rocks
a bottle contains 12 red marbles and 8 blue marbles. A marble is chosen at random and not replaced. Then a second marble is chosen at random. Determine the prob
when did fair trade start
what type of monkey starts with an h?
How do u do this ??? Alistair buys an antique chair for £600. It is expected to increase in value at the rate of 4.5% each year. How much is it expected to be w
How to convert 0.39 into a fraction?
How do you solve x²-10x+9=0 by completing the square?
Explain the statement that waves cause both constructive and destructive change to the shore line
what is an example of a narrative poem
what two large alliances took shape before the beginning of world war 1