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

 

norm.krumpe@muohio.edu > sumString
prev  |  next  |  chance

Given a string containing space-separated integer values, compute the sum of those values. Each string will contain at least one number.


sumString("1 2") → 3
sumString("1 2 3") → 6
sumString("7 -7 0 59") → 59

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

int sumString(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: 200 Post-solution available

Copyright Nick Parlante 2017 - privacy