CSI Sample Final Summer 2010

CSI Sample Final Summer 2010 - QUESTION 1 Add full Javadoc...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: QUESTION 1 Add full Javadoc compliant comments to the following method. Be sure to describe the behavior of the method. For full credit, also add comments in the method to explain each block of code. public static int doesSomething(Picture a, Color c) { int n = 0; for(int x = 0; x < a.getWidth(); x++) for(int y = 0; y < a.getHeight(); y++) if(a.getPixel(x,y).colorDistance(c) <= 1) n++; return n; } Introduction to Computer Science CSI201 Summer 2010 SAMPLE QUESTIONS FOR FINAL QUESTION 2 Create a method called rollDie() that will simulate rolling a die. The method should return a random integer that will be either 1, 2, 3, 4, 5, or 6. Csi 201 - Sample Final - Summer 2010 QUESTION 2 Create a method called rollDie() that will simulate rolling a die. The method should return a random integer that will be either 1, 2, 3, 4, 5, or 6. Csi 201 - Sample Final - Summer 2010 Page 2 QUESTION 3 Consider the following Java statements: String a = "Australopithecus"; String b = "12"; String c = "3"; String d = "x";...
View Full Document

This note was uploaded on 02/14/2011 for the course CSI 201 taught by Professor Doanne during the Summer '08 term at SUNY Albany.

Page1 / 5

CSI Sample Final Summer 2010 - QUESTION 1 Add full Javadoc...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online