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

 

tmhscs@gmail.com logic > logic_closeOrFar2
prev  |  next  |  chance

Given two integers, a and b, return "close" if they are the same value or differ by 1. Return "far" if their values differ by more than 1.


logic_closeOrFar2(1, 1) → "close"
logic_closeOrFar2(1, 2) → "close"
logic_closeOrFar2(1, 3) → "far"

...Save, Compile, Run (ctrl-enter)

public String logic_closeOrFar2(int a, int b) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2017 - privacy