Write a function that will scale down just a part of the picture. Make someone’s head look smaller.

What will be an ideal response?


```
def squishTheHead (scr, x, y, w, h):
canvas = makeEmptyPicture(getWidth(scr), getHeight(scr))
for i in range(0, getWidth(scr)):
for j in range(0, getHeight(scr)):
p = getPixel(canvas, i, j)
p2 = getPixel(scr, i, j)
color = getColor(p2)
setColor(p, color)
sourceX = 0.0
for targetX in range(x,x+int(w/2)):
sourceY = 0.0
for targetY in range(y,y+int(h/2)):
px = getPixel(scr,int(sourceX),int(sourceY))
color = getColor(px)
setColor(getPixel(canvas ,int(targetX) ,int(targetY)), color)
sourceY = sourceY + 2
sourceX = sourceX + 2
show(canvas)
return canvas
```

Note: This halves the passed in area of the picture.

Computer Science & Information Technology

You might also like to view...

What output is sent to the file out.dat by the following code, assuming these lines of code are embedded in a correct program?

``` ofstream fout; fout.open("out.dat"); fout << "*" << setw(5) << 123 << "*" << 123 << "*" << endl; fout.setf(ios::showpos); fout << "*" << setw(5) << 123 << "*" << 123 << "*" << endl; fout.unsetf(ios::showpos): fout.setf(ios::left); fout << "*" << setw(5) << 123 << "*" << setw(5) << 123 << "*" << endl; ```

Computer Science & Information Technology

________ is a statistical hypothesis test that helps determine if samples of data were taken

from the same population. Fill in the blank(s) with correct word

Computer Science & Information Technology

Briefly describe each of the following CSS overflow values: visible, hidden, scroll and auto. Indicate which of these four values is the default.

What will be an ideal response?

Computer Science & Information Technology

The business of making multimedia is a "low entry barrier" enterprise because:

a. those with disabilities can create multimedia. b. all you need to get started is some (relatively) inexpensive computer hardware and software. c. free or low-cost Web hosting solutions available. d. lots of people can access Web sites and CD-ROMs. e. authoring systems make creating sophisticated projects fast and easy.

Computer Science & Information Technology