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

This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Midterm Exam 1 Review Spring 2004: Which does which

(Return to Sp2004 Midterm 1 Review)

Questions, answers, comments on answers, comments on questions?



Catherine Covington
Answer 2, Recipe D takes a picture and removes all the blue from every pixel of that picture that already has a blue value of REMOVED than 100, correct?


In that case, what do the rest of them do? Student117

But don't you think it will probably be helpful for you to know that incase it's on the exam??

i think D is the answer, but what does C do?

One way to work out what C does is to think it through line by line. If the expression in the 'if' statement is difficult to understand (You should be able to understand it literally, but you may not get its significance, try paraphrasing it approximately.) Colin Potts

Another idea is to predict the effect it will have on a picture, run the function on a picture that you're familiar with, and then try to work out what it did if your prediction was way off. You won't have access to JES in the midterm, so you won't be able to do this on Monday. But if you think about what each of the functions do and then test that understanding against what JES actually does, you'll probably be better prepared if a question like this comes up. Colin Potts

Any feedback? Does...
A. Set every blue pixel value in the x,y range of 1 to 99 equal to 100
B. Set every pixel that currently contains any blue equal to 100
C. Set the pixels whose RGB distance is greater than 100 from the specified blue equal to 0
D. Removes all blue from every pixel
Meredith Harman
A, B, and C look good...look at D again though, does it remove the blue from EVERY pixel? Student554

I am pretty certain the answer is D. D removes the blue from every pixel over 100. C takes the distance - when applying the cartesian formula that won't do what the question is asking. For A & B it does what the others who've already posted have said. Student1217

I agree with that. D is the answer because 100 is the value of the pixel and not the distance FROM blue (C).

hey meredith, didn't you mean 0 to 99 for A?

Kristin Noell
A. Sets the blue value to 100 for all pixels in the x,y range of 1 to 99.
B. For every pixel in the picture, if the blue value is not zero it is set to 100.
C. For every pixel in the picture, if the cartesian distanc between the pixel color and the color (0, 0, 100) is greater than 100, it sets the blue value of the pixel to 0.
D. (the answer) Removes all the blue from every pixel of the picture with a blue value greater than 100.

Sounds good to me! Student554

No I don't think there is a O pixel. so what A does is look in a box that is from x 1-99 and y 1-99. then ir sets all the blue in those pixels to a hundred. Sabrina REMOVED

Shouldn't the "if" statement be also indented in answer D?
Yes, it should be. Student554

Student1212 (forgot to sign)

So, to sum up, the answer is "D" and that should look like it does in the problem, yet the "if" line is indented one REMOVED over? Is that what everyone else things?
Student1310




Link to this Page