Lab5 Class
Implement the missing parts of the Lab5 Class, as indicated by the TODO Comments.
- Create an array to hold the Dots
- In the
setup()
function (specified by the TODO comment), fill the array with new Dots with randomly generated x- and y-coordinates. - Implement a draw method in Lab5 which calls the
draw()
method from Dot. Every Dot should draw itself. - Find and print the distance between the two most distant Dots in your array.
Random Number Generator
A random number generator has been implemented for you already in Lab5.java. You can call getRandomFloat( maximum )
to get a random float between 0 and the maximum value you specify. This will allow you to give each of your dots a random x- and a random y-coordinate between 0 and the limit of the window (WINDOW_SIZE).