Question: Point: double getX ( ) double getY ( ) void setX ( double x ) void setY ( double y ) void rotateAbout ( Point

Point:
double getX()double getY()void setX(double x)void setY(double y)void rotateAbout(Point point, double angle)
Line:
Point getFirstPoint()Point getSecondPoint()void setFirstPoint(Point point)void setSecondPoint(Point point)Line[] getLines()
Rectangle:
Point getCenter()double getWidth()double getHeight()void setCenter(Point center)void setWidth(double width)void setHeight(double height)void rotate(double angle)Point[] getPoints()Line[] getLines()
Square:
Point getCenter()double getWidth()double getHeight()void setCenter(Point center)void setWidth(double width)void setHeight(double height)void rotate(double angle)Point[] getPoints()Line[] getLines()
Triangle:
Point getCenter()void setCenter(Point center)void rotate(double angle)Point[] getPoints()Line[] getLines()
Polygon:
Point getCenter()void setCenter(Point center)void rotate(double angle)Point[] getPoints()Line[] getLines()
NGon: (note that you may add number of sides to the constructor)
Point getCenter()double getSideLength()int getNumSides()void setCenter(Point center)void setSideLength(double length)void rotate(double angle)Point[] getPoints()Line[] getLines()
EquilateralTriangle:
Point getCenter()double getSideLength()void setCenter(Point center)void setSideLength(double length)void rotate(double angle)Point[] getPoints()Line[] getLines()
For this project, you will add three more types to your hierarchy (plus any additional classes, abstract classes or interfaces are needed to get a good hierarchy). You may also add additional methods to those listed.
The types you are adding will represent fractals. A fractal is a shape that has a repeated pattern to it. Our fractals will be created with a "base shape" and a "level". The base shape is the starting shape for the fractal and the level is the number of times the pattern is applied. Each fractal will take some of the above shapes as its "base shape".
Hint 1: as with project 3, spend some time designing a good hierarchy before you code. Part of the grade will based on your hierarchy.
Hint 2: you may find generic types will be useful in building the hierarchy.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!