Question: Sections 15.2-15.4 15.1 (The Triangle class) Design a class named Triangle that extends GeometricObject. The class contains the following Three double data fields named sidel,


Sections 15.2-15.4 15.1 (The Triangle class) Design a class named Triangle that extends GeometricObject. The class contains the following Three double data fields named sidel, side2, and side3 to denote three sides of the triangle. A no-arg constructor that creates a default triangle with each side 1.0. A constructor that creates a rectangle with the specified sidel, side2, and side 3. The constant accessor functions for all three data fields. A constant function named getArea C) that returns the area of this triangle. A constant function named getPerimeter that returns the perimeter of this triangle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
