Wednesday September 15.
To make sure that summer has not erased too much of our long-term memory, here
is a simple Java assignment. Submit the sources for the classes you declare,
and make sure to include a few paragraphs describing your approach.
Given a set of points in the plane, the diameter of the set is the largest
distance between any two of these points. Distance has its usual meaning:
Sqrt ((x1-x2)^2 + (y1-y2)^2). The assignment consists in writing
a program that determines the diameter of such a set. Each point is described
by a pair (X, Y) or coordinates, that are represented as double precision
floating point numbers (doubles).
Given that the course is about object-oriented methods, you should define the
classes in way that will be generally useful. Suggest some methods that might
be useful for these classes. (no need to provide full implementations).
The problem involves a collection of objects, so you should think about the
best way of representing this collection.
To test your program, use the random number generator to create 100 points,
and output the coordinates of the two points that define the diameter (i.e.
the two points that are farthest apart).