public Triangle() { a = 1; b = 1; c = 1; type = triangleType.equilateral; }
private void calculateType() { if (a == c && b == c) type = triangleType.equilateral; else if (a == b || a == c || b == c) type = triangleType.isosceles; else type = triangleType.scalene; }
private bool isTriangle() { if (a <= 0 || b <= 0 || c <= 0) { this.type = triangleType.notATriangle; return false; } else { if (((a + b) > c) && ((a + c) > b) && ((b + c) > a)) { return true; } else { this.type = triangleType.notATriangle; return false; } } }