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

 

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

Write a method that returns the sum of the digits in 'num' except do NOT count any occurrence of 'excludeDigit'. For example, if 'num' is 812451 and 'excludeDigit' is 1, you would return 19 since 8+2+4+5=19.


quiz2020_12_15_P1SLHL_sumDigitsExclude(54678, 2) → 30
quiz2020_12_15_P1SLHL_sumDigitsExclude(123456, 7) → 21
quiz2020_12_15_P1SLHL_sumDigitsExclude(54678, 8) → 22

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

public int quiz2020_12_15_P1SLHL_sumDigitsExclude(int num, int excludeDigit) { }

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

Copyright Nick Parlante 2017 - privacy