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

 

jebbert@volusia.k12.fl.us > mar27_2017_APSLHL_countDigit
prev  |  next  |  chance

Write a RECURSIVE method that accepts a positive integer called origNum and an integer called countDigit which will be a single digit from 0 to 9. Return the number of times that digit appears in origNum. Please note that the digit might not appear at all. Absolutely no string commands or variables are allowed!!! READ THE PREVIOUS SENTENCE AGAIN. You MUST write a recursive solution to earn any credit. READ THE PREVIOUS SENTENCE AGAIN.


mar27_2017_APSLHL_countDigit(142112, 1) → 3
mar27_2017_APSLHL_countDigit(123456, 5) → 1
mar27_2017_APSLHL_countDigit(5554422, 5) → 3

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

public int mar27_2017_APSLHL_countDigit(int origNum, int countDigit) { }

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: 280

Copyright Nick Parlante 2017 - privacy