Question: Point: double getX ( ) double getY ( ) void setX ( double x ) void setY ( double y ) void rotateAbout ( Point
Point:
double getXdouble getYvoid setXdouble xvoid setYdouble yvoid rotateAboutPoint point, double angle
Line:
Point getFirstPointPoint getSecondPointvoid setFirstPointPoint pointvoid setSecondPointPoint pointLine getLines
Rectangle:
Point getCenterdouble getWidthdouble getHeightvoid setCenterPoint centervoid setWidthdouble widthvoid setHeightdouble heightvoid rotatedouble anglePoint getPointsLine getLines
Square:
Point getCenterdouble getWidthdouble getHeightvoid setCenterPoint centervoid setWidthdouble widthvoid setHeightdouble heightvoid rotatedouble anglePoint getPointsLine getLines
Triangle:
Point getCentervoid setCenterPoint centervoid rotatedouble anglePoint getPointsLine getLines
Polygon:
Point getCentervoid setCenterPoint centervoid rotatedouble anglePoint getPointsLine getLines
NGon: note that you may add number of sides to the constructor
Point getCenterdouble getSideLengthint getNumSidesvoid setCenterPoint centervoid setSideLengthdouble lengthvoid rotatedouble anglePoint getPointsLine getLines
EquilateralTriangle:
Point getCenterdouble getSideLengthvoid setCenterPoint centervoid setSideLengthdouble lengthvoid rotatedouble anglePoint getPointsLine 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 : as with project spend some time designing a good hierarchy before you code. Part of the grade will based on your hierarchy.
Hint : 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
