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

 

apcsaArraysGrainsOfSand


Given a String containing a series of integers separated by single spaces representing the number of grains in different small sand piles, calculate and return the sum of all those numbers as an integer.


HINT: Convert Strings to integers using Integer.parseInt(arr[i]).

apcsaArraysGrainsOfSand("1 2 3") → 6
apcsaArraysGrainsOfSand("10 20 30") → 60
apcsaArraysGrainsOfSand("100") → 100

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

public int apcsaArraysGrainsOfSand(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: 220

Copyright Nick Parlante 2017 - privacy