id/email
password
forgot password
about | help | done | prefs | create account
JavaBat java practice problems

Logic-2 > closeFar
prev  |  next  |  chance

Given three ints, A B C, return true if one of B or C is "close" (differing from A by at most 1), while the other is "far" (differing from both other values by 2 or more). Note: Math.abs(int) computes absolute values.

closeFar(1, 2, 10) → true
closeFar(1, 2, 3) → false
closeFar(4, 1, 3) → true

...Save, Compile, Run

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


prev  |  next  |  chance   |  JavaBat  >  Logic-2

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

Copyright Nick Parlante 2006-09 - privacy