Quiz3.fa10

Quiz3.fa10 - Signature _ cs8f _ CSE 8A Quiz 3 Fall 2010...

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 3 cs8f ____ Fall 2010 Student ID ____________________ This quiz is to be taken by yourself with closed books, closed notes, no electronic devices. How many times does the body of this loop execute? ________ for ( int i = 10; i >= 0; --i ) { System.out.println( "CSE8A Rocks! " + i ); } With regards to the loop above, what is the last value of i that is printed? ________ The following method mirrors a Picture vertically left to right. this is a Picture that we are applying the mirroring. public void mirrorVertically() { int mirrorPoint = this.getWidth() / 2; Pixel leftPixel = null; Pixel rightPixel = null; Pixel mirrorPixel = null; for ( int y = 0; y < this.getHeight(); ++y ) { for ( int x = 0; x < mirrorPoint; ++x ) { leftPixel = this.getPixel( x, y ); rightPixel = this.getPixel( this.getWidth() – 1 – x, y ); mirrorPixel = this.getPixel( mirrorPoint, y ); /* MISSING LINE */ } } } Which missing line of code will correctly mirror this Picture vertically left to right? _______ A)
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

Quiz3.fa10 - Signature _ cs8f _ CSE 8A Quiz 3 Fall 2010...

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