This assignment must be completed by 10:10 AM on 9 November, and uploaded to the Homework 10 moodle page. You should upload the following three classes: RotatedRectangle.java, Pumpkin.java and Home10Sketch.java .
This lab is a natural extension of Homework 9 and the 29 October pumpkin lab.
Implementing an interface — once
Take your RotatedRectangle solution for
Homework 9 and modify it to implement the
ProcessingDrawable2D interface of the
pumpkin lab.
The only real work you need to do beyond
Homework 9 is
writing the draw class.
Continue to call this class RotatedRectangle and place
it in the edu.unca.cs.csci202 package.
Implementating an interface — twice
Take your Pumpkin class from the pumpkin lab and
make sure it implements the
ProcessingDrawable2D interface. This should require you to add two words
to your code.
Using the interface
Next, following the directions in the
pumpkin lab,
implement a Processing sketch similar to the
Halloween class of the
pumpkin lab
that draws all the elements
of an single array (or single ArrayList)
of ProcessingDrawable2D objects created for your sketch.
Call this class Home10Sketch and place
it in the edu.unca.cs.csci202 package.
It is not necessary for your Home10Sketch to perform an
animation, but you will not get more than 90% on the assignment
if the display of the sketch is completely static.
Starting it off
Use the following Java class to start your program running.
package edu.unca.cs.csci202;
import processing.core.* ;
// add core.java in the core/library subdirectory of processing
/**
*
* @author J Dean Brock <brock@unca.edu>
*/
public class Home10Starter {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
PApplet.main(new String[]{"edu.unca.cs.csci202.Home10Sketch"}) ;
}
}