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

AP-1 > hasOne
prev  |  next  |  chance

Given a positive int n, return true if it contains a 1 digit. Note: use % to get the rightmost digit, and / to discard the rightmost digit.

hasOne(10) → true
hasOne(22) → false
hasOne(220) → false

...Save, Compile, Run

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


prev  |  next  |  chance   |  JavaBat  >  AP-1

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

Copyright Nick Parlante 2006-09 - privacy