Given the following: public int mystery(int x , int y) { if(x < 0) return -myste
ID: 3608644 • Letter: G
Question
Given the following: public int mystery(int x , int y) { if(x < 0) return -mystery(-x,y); else if(x < y) return x; else return mystery(x -y,y); } What is returned by the method call: [a] mystery(16, 27)__________ [b] mystery(27, 16)__________ [c] mystery(50, 11)__________ [d] mystery(47, 10)__________ [e] mystery(-23, 9)__________ [f] What is the purpose of method mystery?____ a) find gcf b) find x % y c) find lcf d) find y % x Given the following: public int mystery(int x , int y) { if(x < 0) return -mystery(-x,y); else if(x < y) return x; else return mystery(x -y,y); } What is returned by the method call: [a] mystery(16, 27)__________ [b] mystery(27, 16)__________ [c] mystery(50, 11)__________ [d] mystery(47, 10)__________ [e] mystery(-23, 9)__________ [f] What is the purpose of method mystery?____ a) find gcf b) find x % y c) find lcf d) find y % xExplanation / Answer
//Hope this will help you.. [a] 16 [b] 11 [c] 6 [d] 7 [e] -5 [f] b //here is trace of each call callingmystert(16,27) xRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.