Quiz5.fa08

Quiz5.fa08 - Signature _ cs11f _ CSE 11 Quiz 5 Fall 2008...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 11 Name ________________________ Quiz 5 cs11f ____ Fall 2008 Student ID ____________________ This quiz is to be taken by yourself with closed books, closed notes, no calculators. Write a method named dSum() that takes an array of double s as a parameter and returns the sum of all elements in the array. Use the standard for loop; do not use the enhanced for / foreach loop. (I will ask you to use the enhanced for/foreach loop on the Final.) Fill in the blanks to complete this method definition. public _______________ dSum( __________________ array ) { ___________ sum = ____________; for ( _________________; _____________________; _________________ ) { ______________________________________; } return ________________; } Fill in the blanks in the code to correctly produce the multiple array layout below: int[][] a; a a = new int[___][]; a[___] = new int[___]; a[0] = new int[___]; a[___] = new int[4]; Write the assignment statement to set the array element marked by the X to the value 42. (Over)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Quiz5.fa08 - Signature _ cs11f _ CSE 11 Quiz 5 Fall 2008...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online