public class Triangle implements iShape { private double base; private double height; public Triangle(double base, double height) { this.base = base; this.height = height; } public double area() { return (base * height) / 2; } public double perimeter() { //assuming this is a right triangle double c = Math.sqrt(base*base + height*height); return c + base + height; } }