{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Section1Problems 1 - CSE143 Section 1#1 Problems arr Qi...

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 #1 Problems arr'\' Qi mrrlation. You are to simulate the executi-on of a method that manipulates an array of integers. Consider the following method: public void mystery (int [ ] Iist static (int for i : 0,. i < list.length (i z 2 if 0) { list Ii] ++; ) else { isrIi]--; I ) \; { i++) { ) ) you are to In the l-eft-hand column below are specific lists of integers. i-ndicate in the right-hand column what va.l-ues would be stored in the list method mystery after executes if the integer Iist in the". left-hand col-umn is passed as a parameter to mystery. OriginalList Final List IA ?I {2, {r, 12, {7, Z. 4, 2, 2, 3, 6l 3, 2, 2, 4l 2, 0, 2\ 5, 1) Array You are to simulate simul-ation. the execution of a method that manipulates an array of integers. Consider the fol-lowing method: public void mystery(lntJl static list) { j-++) (int for i : L; i < Iist.Iengtht + IistIi listIi] listIi] 1]; i you are to In the left-hand column below are specific lists of integers. indicate in the right.-hand column what values would be stored in the l-ist method mystery after executes if the integer list in the left-hand cofumn is passed as a parameter to mystery. Original List Final List {B} 16, 12, {1, {'7, 3) 4, 2, 3, 6) 3, 2, 4t 0, 5} ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online