Draw horizontal and vertical lines on a picture with 10 pixels between the lines.

This is simple enough to do as it simply means taking Program 87 and changing both 5’s to 10’s. Like so:


```
def lineExample ():
img = makePicture(pickAFile())
verticalLines(img)
horizontalLines(img)
show(img)
return img
def horizontalLines(src):
for x in range(0,getHeight(src),10):
for y in range(0,getWidth(src)):
setColor(getPixel(src,y,x),black)
def verticalLines(src):
for x in range(0,getWidth(src),10):
for y in range(0,getHeight(src)):
setColor(getPixel(src,x,y),black)
```

Computer Science & Information Technology

You might also like to view...

Creating a separate node class that holds a reference to another node and a reference to an object that is being stored in a list is a good design because it

a) makes the code more complicated b) hides the implementation details of a collection c) reduces code reuse d) all of the above e) neither a, b nor c

Computer Science & Information Technology

A menu item may be executed by a user in each of the following ways except __________.

a. by pressing access keys such as Alt + F b. by pressing shortcut keys such as Ctrl + S c. by clicking on the item d. by hovering the mouse over the item

Computer Science & Information Technology

In the accompanying figure, Item 1 points to an anchor icon, which indicates a(n) ____.

A. SmartArt graphic B. resized image C. floating image D. inline graphic

Computer Science & Information Technology

What's in the Slide Master, and how do you create and save a new one?

What will be an ideal response?

Computer Science & Information Technology