about | help | code help+videos | done | prefs |
triangleClassification
A triangle is valid if the sum of any two sides is greater than the third side. Write a method, triangleClassification() that takes three int parameters, side1, side2 and side3 and returns a string value that classifies the triangle (so isosceles, equilateral, scalene or NOT a triangle). So, a+b > c and a+c > b and c+b > a must be true first to make sure it forms a triangle! Then classify. triangleClassification(3, 5, 9) → "NOT a triangle" triangleClassification(3, 3, 5) → "Isosceles" triangleClassification(3, 4, 6) → "Scalene" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100 Post-solution available
Copyright Nick Parlante 2017 - privacy