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

 

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

Write a recursive method that returns the sum of all the even digits in a non-negative integer. Your solution MUST use recursion in a non-trivial way. Make sure you solution is clear and uses good, considerate programming methodology. Be careful! This one is a little tricky! Remember that when you are not in the base-case there MUST be a recursive call of some sort.


vpeepsEvenDigitSum(42892) → 16
vpeepsEvenDigitSum(52152) → 4
vpeepsEvenDigitSum(123456) → 12

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

public int vpeepsEvenDigitSum(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: 390

Copyright Nick Parlante 2017 - privacy