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

 

findLuckyDigits


In China, 8 is considered a very lucky number. Create a method findLuckyDigits that takes in a three-digit number (num will always be 3 digits). Count how many digits are equal to 8. Return that count.


findLuckyDigits(838) → 2
findLuckyDigits(888) → 3
findLuckyDigits(123) → 0

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

public int findLuckyDigits(int num) }

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

Copyright Nick Parlante 2017 - privacy