Quiz2.fa10

Quiz2.fa10 - Signature _ cs8f _ CSE 8A Quiz 2 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 2 cs8f ____ Fall 2010 Student ID ____________________ This quiz is to be taken by yourself with closed books, closed notes, no electronic devices. Which of the following are class methods? Circle your answers. (+1 if correct; -1 if incorrect. No negative pts.) Math.abs( -3 ); soundObj.play(); FileChooser.pickAFile(); pictureObj.show(); turtle1.turnLeft(); ColorChooser.pickAColor(); What does the following code do? Give a high level answer in plain English words. Assume this method is stored in the file Picture.java public void fubar() { Pixel[] pixelArray = this.getPixels(); for ( Pixel p : pixelArray ) { p.setRed( 255 ); p.setGreen( 0 ); p.setBlue( 0 ); } } The following is a for loop. Write the equivalent as a while loop. Be sure to put the comment // Some stuff in the correct location in relation to the other parts of the while loop you write. for (int i = 0; i < 30; i++)
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

Quiz2.fa10 - Signature _ cs8f _ CSE 8A Quiz 2 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