CSCI 202 homework 13

Rules of submission

This assignment must be submitted to the Moodle submission page for Homework 13 by 11:00 PM on Friday, 26 April.

Your submission must contain at least the five Comparator classes that you are asked to complete below. You may also submit in an enhanced PDriver class for use in future classes! You can turn it your programs as separate files or in a ZIPped NetBeans project.

The assignment

Do this.
I guess that didn’t work. In that case, trying downloading the jar file and running it on your computer.

Actually, you only have to complete a few Comparator classes. Start by unzipping a NetBeans project into your NetBeansProjects directory. Start up NetBeans and load the project.

The main application class is PDriver, which is in the edu.unca.cs.csci202 package. PDriver extends Processing’s PApplet class and looks quite a bit like a Processing application.

PDriver generates a bunch of random Point1080 objects and then calls the sort method of the Java collections framework to arrange these objects and display them using the colors of the rainbow. You can also use your mouse to add new Point1080 to fill in the random holes.

The color arrangment is done by calling seven classes that extend the Comparator. Two of those classes, ComparatorHorizonal and ComparatorDistance, are finished. Your job is to complete the other five, which are listed below.