Write class called Triangle that can be used to represent a triangle. It should include the following
Fantastic news! We've Found the answer you've been seeking!
Question:
Write class called Triangle that can be used to represent a triangle. It should include the following methods:
a) is_scalene (no two sides are the same length)
b) is_isosceles (exactly two sides are the same length)
c) is_equilateral (all three sides are the same length)
d) calculatePerimeter (calculate the perimeter of the triangle)
Write separate .java file with the main method to test the Triangle class.
Here is the Triangle class structure (Triangle.java):
Class Triangle {
int side1;
int side2;
int side3;
boolean isScalene() {
}
boolean isIsosceles() {
}
boolean isEquilateral() {
}
int calculatePerimeter(){
}
}
Related Book For
Introduction to Operations Research
ISBN: 978-1259162985
10th edition
Authors: Frederick S. Hillier, Gerald J. Lieberman
Posted Date: