Browse Source

Mit Kommentaren

master
Mikko Winkler 2 years ago
parent
commit
d85421a6db
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      src/TriangleChecker.java

+ 3
- 0
src/TriangleChecker.java View File

// Analyse der Dreiecksart // Analyse der Dreiecksart
public static TriangleType checkTriangle(float a, float b, float c) { public static TriangleType checkTriangle(float a, float b, float c) {


//Dreieck
if( (a+b>c) && (c+b>a) && (a+c>b)) { if( (a+b>c) && (c+b>a) && (a+c>b)) {
//Gleichschenkliges Dreieck
if(a==b || b==c|| a==c) { if(a==b || b==c|| a==c) {
//Gleichseitiges Dreieck
if (a == b && b == c && a == c) return TriangleType.EQUILATERAL; if (a == b && b == c && a == c) return TriangleType.EQUILATERAL;
return TriangleType.ISOSCELES; return TriangleType.ISOSCELES;
} }

Loading…
Cancel
Save