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

Log (10-4x) = log (10-3x)
Which class of organic compounds contains nitrogen? (I) aldehyde (2) alcohol (3) amine (4) ether
How old do citizens have to be to vote for President?
Find the x and y intercept of the line 5x-4y=30.the graph
The accepted value for the percent by mass of water in a hydrate is 36.0%. In a laboratory activity, a student determined the percent by mass of water in the hy
How to write third person and describe please give me Ideas thank you
Name one U.S. territory
When lithium reacts with bromine to form the compound LiBr each lithium atom (1) gains one electron and becomes a negatively charged ion (2) gains three electro
Given the balanced equation representing a reaction: 4Al(s) + 3O2(g) ==> Al2O3(s) As the aluminum loses 12 moles of electrons, the oxygen (1) gains 4 moles o
What is the name of the Vice President of the United States now?