Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Mirroring Left to Right: What are the parameter values used to index leftP and r

ID: 3840282 • Letter: M

Question

Mirroring Left to Right:

What are the parameter values used to index leftP and rightP for the first three iterations of the loop? Give the x and y coordinates for leftP and for rightP. Assume the picture has a height of 50 and width of 100.

Please Answer Which of the following best describes the code, and why?

A. y increases faster than x
B. x increases faster than y
C. x and y increase together, instep

D. x increases for awhile, then y increases once, then x restarts and increases again

E. y increases for awhile, then x increases once, theny restarts and increases again

} }

Explanation / Answer

Option D is the right answer because in order to mirror from left to right,we need to iterate over entire height ,and for every step in height we have to mirror pixels from left half to right half in a symmetric way.

For first 3 iterations the pixels mirrored are,

(0,0) and (99,0)

(1,0) and(98,0)

(2,0) and (97,0)