about | help | code help+videos | done | prefs |
public boolean inBothRanges(int number)
public boolean inBothRanges(int number) { boolean inRange1 = false; if (0 <= number && number <= 100) { inRange1 = true; } boolean inRange2 = false; if (50 <= number && number <= 200) { inRange2 = true; } boolean inBothRanges = false; if (inRange1 && inRange2) { inBothRanges = true; } return inBothRanges; } inBothRanges(50) → true inBothRanges(100) → true inBothRanges(0) → 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