Question: Write a static method named runningSum that takes an array of integers as a parameter and modifies the given array so that it contains a
Write a static method named runningSum that takes an array of integers as a parameter and modifies the given array so that it contains a running sum of its original values.
For example, if the array originally had the values {3, 2, 4, 7}, after running your method that array would instead contain {3, 5, 9, 16}, and if you ran it another time on the same array, you'd have {3, 8, 17, 33}.
i..e
Original array = {3, 2, 4, 7} Result array = {3, 5, 9, 16}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
