Learn to Program with ZedLX

Free Online Programming Course for Beginners

Arrays [8/11]

This program uses an array of five points. The array is named centers. Then it draws discs at the positions given by the array centers.

To see the coordinates of each disc printed out, uncomment the line starting with /// .

Exercise (Challenging!):

  1. Modify the program to paint each disc in a different color, using labeled initializers to define the colors.

    (The solution is provided on the next page.)

Loading...