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

Info icon This 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) rightPixel.setColor( leftPixel.getColor() ); B) leftPixel.setColor( rightPixel.getColor() ); C) rightPixel.setColor( mirrorPixel.getColor() ); D) leftPixel.setColor( mirrorPixel.getColor() );
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern