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

 

andersoniii.edwin@cusd80.com > findTheFours2
prev  |  next  |  chance

FindingThe4's in numbers. Write the method that accepts a positive integer and returns the count of the number of occurrences of "4". Be sure to check the integer being positive as if it is negative, return zero fours. Example: 1234567 would return 1.


findTheFours2(1234567) → 1
findTheFours2(9544567) → 2
findTheFours2(12349876) → 1

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

public int findTheFours2(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

Difficulty: 110

Copyright Nick Parlante 2017 - privacy