id/email
password
forgot password
about | help | done | prefs | create account
CodingBat code practice

canBeTriangle

Given three lengths, return true if a triangle can be created with sides of those lengths. This happens if the largest of the three lengths is smaller than the total of the other two lengths.

canBeTriangle(3, 3, 3) → true
canBeTriangle(5, 13, 12) → true
canBeTriangle(14, 5, 8) → false

...Save, Compile, Run         

See also Java Example Code. Java help docs: If Boolean Logic | Strings | While and For Loops | Arrays and Loops

Forget It! -- delete my code for this problem 170

Copyright Nick Parlante 2006-10 - privacy