Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Computer Graphics Exercises [8/9]

This program draws horizontal lines. The lines are 50 pixels apart. One end of each line is at x=100, and another is at x=800.

Exercise 7 output image

Make the program draw discs at line ends. Disc radius must be 10 pixels. All discs must be drawn before any line is drawn.

To accomplish this task, write another for loop before the given one. The loop should draw two discs on each iteration.

The solution is on the next slide.

Loading...