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

 

amjadm@miamioh.edu assignmentiii > addDigits
prev  |  next  |  chance

Given a strings, adds up the positive digits inside the the string and return the sum. Return zero when there is no digit in the given string.


addDigits("") → 0
addDigits("a0") → 0
addDigits("1fr2") → 3

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

public int addDigits(String str) { }

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: 130 Post-solution available

Copyright Nick Parlante 2017 - privacy