PreQuiz1
Word Version of prequiz1Sum04.doc.
Download the .doc above, print it out, and take the prequiz. If you cannot download that or print it, then print out this entire webpage and take the prequiz. Bring your completed prequiz to class on Monday, You will hand it in right before the actual quiz. You can expect the prequiz and the quiz to have similar types of questions. You are allowed to collaborate, just be sure to tell us who it was that you collaborated with (list all of them).
- 2 Points 1. What is your breakout session (day and time)
Imagine that you have a six pixel picture whose (red, green, blue) values are these:
| (46,46,120) | (16,32,64) | (64,0,128) |
| (65,0,128) | (47,30,30) | (46,32,32) |
- 9 Points 2.What will be the (red, green, blue) values in those same pixels after running the following program?
def replaceLightBlue(picture):
lightBlue = makeColor(0,0,128)
for px in getPixels(picture):
pxColor = getColor(px)
if distance(pxColor,lightBlue) <= 65.0:
setRed(px, 2 * getRed(px))
- 9 Points 3. What will be the (red, green, blue) values in those same (original) pixels after running this program?
def partialNegative(picture):
for p in getPixels(picture):
red=getRed(p)
green=getGreen(p)
blue=getBlue(p)
negColor=makeColor( 64-red, 64-green, 64-blue)
setColor(p,negColor)
You are allowed to collaborate on these pre-quiz, but please identify your collaborators by writing their names below this.
Links to this Page