Section8Problems 1 - CSE143 Section 1 Consider the fol-l_owinq method x int y#8 problems public if int mysteryl(int(x< y ret.urn xi else return

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSE143 Section 1 . Consider the fol-l_owinq method: x, int y) #8 problems public if int mysteryl (int (x < y) ret.urn xi else return mysteryl { (x yr ) For each calr yl ; below, CaII (6, (14, (37, (8, (50, 13) 10) 10) 2') 7) indicate what Value val_ue is Returned returned: Method mysteryl mysteryl mysteryl mysteryl mysteryl 2. Consider the following method: public if voj_d mystery2 (int n) t (n <: 1) System. out.print (n) ; else { myste ry2 (n / 2) , tt + n); System.out.print(", ) below, indicate i For each callwhat output is produced by the method: Method CalI Output produced mystery2 (1) mysteryz (4) mystery2 (1-6l mystery2 (30) mystery2 (1OO) 3. Consider the foLLowing method: public if int mystery3 (int n) { (n < 0) -mystery3 (-n) return ; (n et-se if return n; el-se return mystery3(n / LO + n t 10); ) ...
View Full Document

This note was uploaded on 11/03/2009 for the course CSE 143 taught by Professor Sr during the Spring '08 term at University of Washington.

Ask a homework question - tutors are online