Question: Java Programming Create an interface Perimeter with methods a. double SquarePerimeter(double side) b. double RectanglePerimeter(double len, double wid) c. double CircleCircumference(double radius) d. double TrianglePerimeter(double
Create an interface Perimeter with methods a. double SquarePerimeter(double side) b. double RectanglePerimeter(double len, double wid) c. double CircleCircumference(double radius) d. double TrianglePerimeter(double side1, double side2, double side3) Create a class ShapePerimeter. The class implements the Perimeter interface. Now each method calculate and return the perimeter of its shape. The formulae to calculate perimeter of each shape is given below: Perimeter of Square: 4 * side Perimeter of Rectangle: 2 * (length + width) Circumference of Circle: 2 * PI * radius Perimeter of Triangle: side 1 + side 2 + side 3 Each method ask the user to enter the values to calculate the perimeter Create TestShape class with main and do the following: - Create an object of ShapePerimeter class, call the all the perimeter methods and display the results
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
