Question: (Java) Write a method, sums(), that takes one integer parameter n. The method should create and return an array of n integers. You may assume
(Java)
Write a method, sums(), that takes one integer parameter n. The method should create and return an array of n integers. You may assume that n is greater than or equal to zero. Fill the ith element of the array with the sum of integers from 0 to i inclusive. For example if called with sums(5), the method would return an array of 5 elements containing {0, 1, 3, 6, 10}.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
