Draw diagonal lines on a picture from top left to bottom right using addLine.

This question can potentially be confusing as it suggests that multiple lines need to be drawn, but does not give precise instructions. To simplify, one can assume that they should draw two lines to get from the top left to bottom right, as below:

```
def lineDiagonal ():
img = makePicture(pickAFile())
midHeight = getHeight(img)/2
midWidth = getWidth(img)/2

addLine(img, 0, 0, midWidth, midHeight)
addLine(img, midWidth, midHeight, getWidth(img), getHeight(img))

show(img)
return img
```

Computer Science & Information Technology

You might also like to view...

Overly designed artifacts are the kind of solutions clients seek in designers

Indicate whether the statement is true or false

Computer Science & Information Technology

Which of the following statements is false?

a. A Fragment’s lifecycle is tied to that of its parent Activity. b. There are six Activity lifecycle methods that have corresponding Fragment lifecycle methods—onCreate, onStart, onResume, onPause, onStop and onDestroy. c. When the system calls life cycle methods on an Activity, it will also call the corresponding methods (and potentially other Fragment lifecycle methods) on all of the Activity’s attached Fragments. d. An Activity’s onResume method is called when a Fragment is on the screen and ready for the user to interact with it.

Computer Science & Information Technology