CS 111 - 4/5/18 Exam 2 Tuesday, 4/10/18, during lecture 20 Multiple Choice Questions 2 Write Function Questions - picture manipulation Exam Topics - Lecture Notes 4/3/18 Earn 1% toward final letter grade by writing a potential exam question in Blackboard Forum For Posterization, the colors that I ask you to create are all NAMED color in JES gray, white, black, blue, red, green, yellow, cyan, magenta setColor ( pixel, yellow ) Truth Table for Boolean Operators of: and or not x y | a. b. c. d. ================|==================================== false false | false false true false false true | true false false true true false | true false true true true true | true true false false e. None of the above. Which column shows the result of: ( x and y ) ? what is the result of: ( x < 4 ) and (( y > 10 ) or ( z <= 20 )) Which column shows the result of: ( x or y ) ? Which column shows the result of: ( not y ) ? What modification is being done by the following code? Assume the image is already loaded into the variable pict. wid = getWidth(pict) hgt = getHeight(pict) x = 0 while ( x < wid ) : y = 0 while ( y < hgt ) : pix = getPixel(pict, x, y) r = getRed ( pix ) g = getGreen ( pix ) b = getBlue ( pix ) setRed ( pix , r / 3 ) setGreen ( pix , g / 3 ) setBlue ( pix , b / 3 ) y = y + 1 x = x + 1 a. Making the image darker b. Posterizing the image c. Creating a color negative d. Making a grayscale image e. None of the above. What modification is being done by the following code? Assume the image is already loaded into the variable pict. wid = getWidth(pict) hgt = getHeight(pict) pict2 = makeEmptyPicture ( hgt, wid ) x = 0 while ( x < wid ) : y = 0 while ( y < hgt ) : pixel1 = getPixel ( pict, x, y) c = getColor(pixel1) modX = hgt -1 – y modY = x pixel2 = getPixel ( pict2 , modX , modY ) setColor( pixel2, c ) y = y + 1 x = x + 1 a. Decreases the size of the image b. Rotating the image c. Makes a mirror image of the original d. Cropping the image e. None of the above.