Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Coordinate System Exercises [3/11]

This program draws two intersecting lines.

The line function has the form:
line(x1, y1, x2, y2, color)

Exercise 1: The cyan line lies entirely on the same x coordinate. What is the value of x coordinate for the entire cyan line?

Solution 1

The x coordinate of the entire cyan line equals 340.

Exercise 2: The yellow line lies entirely on the same y coordinate. What is the value of y coordinate for the entire yellow line?

Solution 2

The y coordinate of the entire yellow line equals 410.

Exercise Coord 5-1 output image

Exercise 3: Draw a green disc centered at the intersection of the lines. The radius should be 40 pixels.

Solution 3

disc(340, 410, 40, /green);

Loading...