implement the functionality of a shape class, according to the following: • You must have an interface for Shape . you w

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

implement the functionality of a shape class, according to the following: • You must have an interface for Shape . you w

Post by answerhappygod »

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 )
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply