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
Get step-by-step solutions from verified subject matter experts
