CSE 132 (Spring 2010)
Quiz 2

Name: ________________________  Last 3 ID Digits:________________
public class MyColor {
   private int red, green, blue;
   // ...
}
Recall the MyColor class, and suppose that the values of red, green, and blue are each to be in the range of 0 to 255, inclusively.
Write your answers clearly! Use the back of this page if necessary
  1. Below write the code that would transmit the values of red, green, blue to an OutputStream out in that order. Do not worry about any exceptions.
    
    
    
    
    
    
  2. Suppose a single integer were computed to hold all three of these values as follows:
      int color = (((red * 256) + green) * 256) + blue;
    
  3. What game do you want to do for the final project? You can change your mind later but I'd like to get some idea now.
    
    


Last modified 09:00:39 CDT 03 June 2010 by Ron K. Cytron