**Download Solution**: Click to Download Solution

**Solution File Name**: GeometricObject.docx

**Unzip Password**: prestobear.com

__Problem:__

Sample Java Program for Geometric Object

```
```__1. GeometricObject.java__
/*
* This is the GeometricObject
* This is the base class for the Triangle Class
* This class provide basic methods for the Triangle class
*/
public class GeometricObject {
}

```
```__2. TestTriangle.java__
import java.util.Scanner;
/*
* This class is the clas to Test for the Triangle class
*/
public class TestTriangle {
}

```
```__3. Triangle.java__
/*
* This Class is to take the Triangle parameter and compute
* Design a class named Triangle that extends
* GeometricObject. The class contains:
* Three double data fields named side1, side2, and side3 with default
* values 1.0 to denote three sides of the triangle.
* A no-arg constructor that creates a default triangle.
* A constructor that creates a triangle with the specified side1, side2, and
* side3.
*
* The accessor methods for all three data fields.
* A method named getArea() that returns the area of this triangle.
* A method named getPerimeter() that returns the perimeter of this triangle.
* A method named toString() that returns a string description for the triangle.
*/
public class Triangle extends GeometricObject {
}