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

 

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

Write a method that returns the sum of the EVEN digits in 'num'. For example, if 'num' is 2514387, you would return 14 since 2+4+8=14. As a precondition, you may assume that 'num' is non-negative. Look at the test data for additional examples.


quiz2024_02_20_APP1SLHL_evenDigitSum(124786) → 20
quiz2024_02_20_APP1SLHL_evenDigitSum(0) → 0
quiz2024_02_20_APP1SLHL_evenDigitSum(6) → 6

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

public int quiz2024_02_20_APP1SLHL_evenDigitSum(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: 250

Copyright Nick Parlante 2017 - privacy