(e) Consider a function transpose that the rows and columns of a Picture object
ID: 3761412 • Letter: #
Question
(e) Consider a function transpose that the rows and columns of a Picture object passed to it as a parameter. The function must create picture with rows taken from columns of the parameter picture such that column 0 of the parameter picture becomes row 0 of the new picture; and column 1 of the original picture becomes row 1 of the new picture and so on. The transpose function must return the new picture it creates. Note, that the order of pixels within each row and column is preserved which means that the topmost-leftmost pixel of the new picture is the same as the topmost-leftmost pixel of the new picture is the same as the topmost-leftmost pixel in the parameter picture. Answer the following questions. i. If the following image is assigned to the variable pic: Draw the picture shown by the following code: res=transpose(pic) show(res) ii. Write the algorithm for the transpose function, and explain how it works. What are the key steps that your algorithm must perform? iii. Write the code for the transpose function.Explanation / Answer
Answer:
*************
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.