implement the functionality of a shape class, according to thefollowing:
• You must have an interface for Shape . you will also makefour classes that implements shape which are square,circle, triangle(all sides are equal), and pentagon(all sides areequal).each shape class must be able get the
-area of the shape
-perimeter of the shape
-Get and set the parameters of a shape:
▪ A circle has a radius and a center
▪ A triangle has a the length of the side and centre
▪ A square has a the length of the side and centre
▪ A pentagon has a the length of the side and centre
o being able to move the shape intoother locations according an offset of x and y
the code should have the following files:
▪ Shape.java
▪ Pentagon.java
▪ Circle.java
▪ Triangle.java
▪ Square.java
▪ Main.java (creating a minimum of 2 instances for each shapeand showing the functionality )
implement the functionality of a shape class, according to the following: • You must have an interface for Shape . you w
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am