about | help | code help+videos | done | prefs |
public boolean inEitherOf2Ranges(int number)
public boolean inEitherOf2Ranges(int number) { boolean inRange1 = false; if (32 <= number && number <= 50) { inRange1 = true; } boolean inRange2 = false; if (70 <= number && number <= 90) { inRange2 = true; } boolean inEitherRange = false; if (inRange1 || inRange2) { inEitherRange = true; } return inEitherRange; } inEitherOf2Ranges(32) → true inEitherOf2Ranges(50) → true inEitherOf2Ranges(60) → false ...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: 1
Copyright Nick Parlante 2017 - privacy