Question: public void doStuff() { for ( int x=0; x < pic.getWidth(); x++ ) { for (int y=0; y < pic.getHeight(); y++ ) { Pixel p

public void doStuff()

{

for ( int x=0; x < pic.getWidth(); x++ )

{

for (int y=0; y < pic.getHeight(); y++ )

{

Pixel p = pic.getPixel( x, y );

p.setColor( new Color( 100, 100, 100 ) );

}

}

}

public static void main( String[] args )

{

Picture pic = new Picture( "frog.jpg" );

pic.doStuff();

pic.show();

}

----------------------------------------------------------------

Assuming frog.jpg is a picture of a frog, what picture will this code display when run?

A. A frog

B. A picture thats all gray

C. Nothing: there is a compile error because of an undeclared variable

PLEASE HELP ME! Thanks in advance! (java programming)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!