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

 

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

The "partial sum" of an array is the sum of all the elements from position 0 to position n in the array. For example, the partial sum of the array {3, 4, 2} is {3, 7, 9} (the 7 is the result of 3+4, the 9 is the result of 3+4+2). Write a method that accepts an array of integers and returns the array of partial sums.


quizSLAPHL_P4([3, 5, 2, 0, 1, 4]) → [3, 8, 10, 10, 11, 15]
quizSLAPHL_P4([3, 7, 9, 10]) → [3, 10, 19, 29]
quizSLAPHL_P4([5]) → [5]

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

public int[] quizSLAPHL_P4(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: 210

Copyright Nick Parlante 2017 - privacy