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

 

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

Write a method that keeps a "running sum" of all the numbers in the input parameter array and returns an array of that "running sum". The input parameter array will contain at least one number. The first number of the resulting array will always be the same as the first number in the original array. After that, only add numbers that are greater than 10. So the "running sum" stays the same unless the number in the original array is greater than 10. Look at the test data for examples.


sep27_2016_SLHL_runningSum([4, 7, 20, 15, 2, 4, 7]) → [4, 4, 24, 39, 39, 39, 39]
sep27_2016_SLHL_runningSum([5]) → [5]
sep27_2016_SLHL_runningSum([17, 40, 100, 200]) → [17, 57, 157, 357]

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

public int[] sep27_2016_SLHL_runningSum(int[] nums) { }

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

Copyright Nick Parlante 2017 - privacy