Assigned Date: Monday, Oct. 3, 2005 (sec 2 +1 day)
Due Date: Thursday, Oct. 13, 2005 (sec 2 +1 day)
Due Time: Noon
Last modified on October 06, 2005, at 04:58 PM (see updates)
This assignment focuses on Java inheritance, polymorphism, abstract classes, and interfaces.
Shape class hierarchy to include a class for equilateral triangles and a class for isosceles triangles (i.e.,
Isosceles.java). For a review of such triangles, see triangle formulas. Rename the
Triangle class to
Scalene.java) and make it model scalene triangles – triangles with three, possibly unequal sides.
Shape class and its subclasses to implement the
Relation interface. The
Relation interface methods should compare the areas of individual shapes. (Note: There are several ways to do this. Look for the most elegant one.)
Write a test program (
TestShape.java) that creates a series of shapes and sorts the shapes into ascending order of size using the
Your code should be fully documented via javadoc. Use exceptions to test method preconditions.
Include the following in each class:
Certification of Authenticity:
I certify that this submission is entirely my own work,
as per course collaboration policy.
Name: ________________________ Date: ___________
- Open your BlueJ project.
- Ensure it contains the following:
- Open (edit) each source file and generate the class interface (javadoc). This can be done within the editor window either by pressing CTRL/J , or selecting the Interface drop-down menu item (on the right). (Note: This is necessary to generate your documentation for grading.)
- Under the Project menu, click Create Jar File... . In the dialog box that opens, select Include Source, and press Continue.
- Email the generated
.jar file to email@example.com, by the due date and time.