Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Pre-Quiz1 - Fall 2006

Q1. Who's your grading TA? (Please circle your answer)

Dawn 	 Joel 	  Mark 	   Brian    REMOVEDng-Yen 	  Richard

Q2. True or False

Answer the following questions by circling either True or False.

1. Java is not case-sensitive
(ie...Pixel and pixel are considered the same thing) ________True________False___________

2. In Java, the "int" data type is used to hold an integer value. ___________True________False___________


Q3. Below is the negate method in the class Picture:

  /**
   * Method to negate the picture 
   */
  public void negate()
  {
    Pixel pixel = null;
    
    // get the array of pixels 
    Pixel[] pixels = this.getPixels();
    
    // loop through all the pixels
    for (int i = 0; i < pixels.length; i++)
    {
      // get the current pixel
      pixel = pixels[i];
      
      // set the pixel color values to the new values
      pixel.setRed(255 - pixel.getRed());
      pixel.setGreen(255 - pixel.getGreen());
      pixel.setBlue(255 - pixel.getBlue());

    }
  }


Recall that creating a grayscale version of a picture is done by setting the red, green, and blue all to the same value.



Questions? Answers? Comments?





Link to this Page