Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Midterm Exam 1 Review Spring 2003: Generalized image filter

Try the problem here from Sp 2003 Midterm Review #1



This is what I got. What about the rest of y'all?

def changeRGB(pict,r,g,b):
  for p in getPixels(pict):
    setRed(p,getRed(p)*(1+r))
    setBlue(p,getBlue(p)*(1+g))
    setGreen(p,getGreen(p) * (1+b))



Yeah, your program works, except that you need the "*" on the last line. Other than that, it works for me too.
Rebecca

Okay, it didn't post the "*" for some reason.

I guess you can't put quotes around an asterick.

"asterisk" (spell-checking dude)



Ok, that was the way the program worked for me, but I didn't use quotes and it still worked? Did I do something wrong? Or what are the quotes for?

What quotes? Are there quotes somewhere in the program that I'm not seeing?

Okay, don't anyone panic here. I was referring to putting an asterisk in the posting. When I first saw the program, it lacked the asterisk in the last line of code. I thought that the asterisk was not showing on the page b/c of my quotes and later found out it was due to something else. So, NO QUOTES are in the program or needed in the program!!!
Rebecca Phillips

are the blue and green values supposed to be reversed in the program, or is that a typo?
Kelly Farrell

I'll bet a typo. I'll bet that it results in interesting pictures! Mark Guzdial




Link to this Page