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

 

andersoniii.edwin@cusd80.com > rowSums
prev  |  next  |  chance

Write a method rowSums that calculates the sums of each of the rows in a given two-dimensional array and returns these sums in a one-dimensional array. The method has one parameter, a two-dimensional array arr2D of int values. The array is in row-major order: arr2D[r][c] is the entry at row r and column c. The method returns a one-dimensional array with one entry for each row of arr2D such that each entry is the sum of the corresponding row in arr2D. As a reminder, each row of a two-dimensional array is a one-dimensional array. For example, if mat1 is the array represented by the following table, the call rowSums(mat1) returns the array {16, 32, 28, 20}. Call a helper method arraySum from the previous question. (you will need to copy and save the previous problem below the current problem.


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

public int[] rowSums(int[][] arr2D) }

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

Copyright Nick Parlante 2017 - privacy