Write a function that uses the same process to draw a vertical line down the middle of the picture, and a horizontal line across the middle of the picture, neatly separating the picture into four quadrants. This function can work for any square or rectangular picture.

What will be an ideal response?


```
def drawQuadrants(picture, lineColor):
vertical = getWidth(picture)/2
horizontal = getHeight(picture)/2
for p in getPixels(picture):
x = getX(p)
y = getY(p)

if y==vertical:
setColor(p,lineColor)
if x==horizontal:
setColor(p,lineColor)
```

Note: The question does not specify that a line color should be passed in, so one can just write a function that always uses the same color.

Computer Science & Information Technology

You might also like to view...

The ________ search is adequate for searching through small arrays, but not through large ones.

A) binary B) linear C) selection D) bubble E) random

Computer Science & Information Technology

A general linked list is an important data structure because:

A. it can conserve more memory than an array for large element sizes B. it is much faster than an array in almost every possible situation C. without one, there are no data structures available for which we could search for keys D. it is the only data structure in which each element can be a record of information

Computer Science & Information Technology

A constructor is not normally used to initialize an object's member variables when an object is created.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

You can add a user or group with administrative access to the RODC using the adprep utility

Indicate whether the statement is true or false

Computer Science & Information Technology