Quiz2.wi11

Quiz2.wi11 - Signature _ cs8w _ CSE 8A Quiz 2 Winter 2011...

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

View Full Document Right Arrow Icon
Signature _____________________ CSE 8A Name ________________________ Quiz 2 cs8w ____ Winter 2011 Student ID ____________________ This quiz is to be taken by yourself with closed books, closed notes, no electronic devices. Fill in the blanks in the following code to correctly loop through all the pixels in "this" Picture object. public void someMethodInClassPicture() { // Create an array of all the pixels in this Picture Pixel[] pixelArray = this.______________________________(); int i = __________; // Initialize index variable while ( i < _____________________________________________ ) // Loop thru all pixels { Pixel pixel = _______________________ [ ______ ]; // Access the pixel at each index // Do something with this pixel i_____; // Change index variable to access the next pixel } } The following is a while loop. Write the equivalent as a for loop (not a foreach loop). Be sure to put the comment // Some code here in the correct location in relation to the other parts of the for loop you write. int i = 42;
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.

This note was uploaded on 08/31/2011 for the course CSE 8a taught by Professor Kube,p during the Fall '08 term at UCSD.

Page1 / 2

Quiz2.wi11 - Signature _ cs8w _ CSE 8A Quiz 2 Winter 2011...

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