Create a CartoonPanel class that takes an array of Pictures and displays the pictures from left to right. It should also have a title and author, and display the title at the top left edge and the author at the top right edge.

What will be an ideal response?

```
class CartoonPanel:
def __init__(self, picturesArray, title, author):
self.pictures = picturesArray
sumWidth = 0
maxHeight = 0
for p in picturesArray:
w = getWidth(p)
h = getHeight(p)

sumWidth = sumWidth+w
if h>maxHeight:
maxHeight = h

canvas = makeEmptyPicture(sumWidth, maxHeight+50)
currX = 0
for p in picturesArray:
copy(p, canvas, currX, 50)
currX =currX+ getWidth(p)

canvas.addText(black, 1,20, title)
canvas.addText(black, currX-100,20,author)
self.panel = canvas

def show(self):
show(self.panel)

def copy(source, target, targX, targY):
targetX = targX
for sourceX in range(0,getWidth(source)):
targetY = targY
for sourceY in range(0,getHeight(source)):
px=getPixel(source ,sourceX ,sourceY)
tx=getPixel(target ,targetX ,targetY)
setColor(tx,getColor(px))
targetY=targetY + 1
targetX=targetX + 1
```

Computer Science & Information Technology

You might also like to view...

Which data validation method forces data entry in a field?

A) Default value B) Validation rule C) Required D) Data macro

Computer Science & Information Technology

What are commodity IT assets?

What will be an ideal response?

Computer Science & Information Technology