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

An important factor in the development of the British Empire in the 19th century was its __________.
How many oxygen atoms are found in one molecule of nitric acid, HNO3?
Which is a fused sentence? I love drawing because it exercises my imagination. Our pet poodle loves to sit on our laps and take long naps. Pablo took a music cl
The _____ Party advocated for labor reform.
A number is k units to the left of 0 on the number line . Describe the location of its opposite
Which of the following did not happen because of the slave rebellion in Haiti? Laws were passed to give rights to free black citizens in the country. General L'
What is the holy book of your faith and how does it compare to others? jesus, muhammmad, moses
The _____ Party advocated for labor reform.
It is only fair that we provide fields for all players, not just for the most experienced. What type of appeal is demonstrated here? an appeal to ethics an appe
William, Joseph, Margaret, Frank, and Jeffrey all work for the same company. Frank has been there the longest, eleven years and makes the most money, three time