

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


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 } }
int i = 42;
while ( i >= 17 ) { // Some code here i--; }
Picture bar = new Picture();
_________ foo; // Fill in the type variable foo should be defined as.
foo = ___________________________ ; // Fill in the right side of this assignment stmt // to get the width of the Picture object bar // references.
public class Trace { public static void main( String[] args ) { System.out.println( "main#1" ); foo1(); System.out.println( "main#2 ); foo2(); System.out.println( "main#3" ); }
public static void foo2() { foo3(); System.out.println( "foo#2" ); }
public static void foo1() { System.out.println( "foo#1" ); foo2(); }
public static void foo3() { System.out.println( "foo#3" ); } }
int width = โฆ ; int height = โฆ ; Pixel p; for ( int j = 0; j < height; j++ ) { for ( int i = 0; i < width; i++ ) { p = getPixel( i, j ); p.setColor( Color.Black ); } }
for ( int i = 0; i < width; i++ ) { for ( int j = height โ 1; j >= 0; j-- ) { p = getPixel( i, j ); p.setColor( Color.BLACK ); } }