subject

Consider the following method, sumRows, which is intended to traverse all the rows in the two-dimensional (2D) integer array num and print the sum of all the elements in each row. public static void sumRows(int[][] num)
{
for (int[] r : num)
{
int sum = 0;
for (int j = 0; j < num. length; j++)
{
sum += r[j];
}
System. out. print(sum + " ");
}
}
For example, if num contains {{3, 5}, {6, 8}}, then sumRows(num) should print "8 14 ".
The method does not always work as intended. For which of the following two-dimensional array input values does sumRows NOT work as intended?
A. {{10, -18}, {48, 17}}
B. {{-5, 2, 0}, {4, 11, 0}}
C. {{4, 1, 7}, {-10, -11, -12}}
D. {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
E. {{0, 1}, {2, 3}}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
Which tab is used to change the theme of a photo album slide show? a. design b. view c. transitions d. home
Answers: 1
question
Computers and Technology, 24.06.2019 12:50
When is it most apprpriate for a development team to change the definition of done
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
Aobject is used for displaying the results of a question based on stored data. a. query b. report c. table d. form
Answers: 2
question
Computers and Technology, 25.06.2019 03:00
1. how do you view the edited document without the track changes markup? a. select accept all changes in document in the accept drop-down menu.b. click on restrict editing in the protect group.c. click on the reviewing pane drop-down menu in the tracking group.d. click on final in the display for review drop-down menu.
Answers: 3
You know the right answer?
Consider the following method, sumRows, which is intended to traverse all the rows in the two-dimens...
Questions
question
Mathematics, 07.12.2020 19:00
question
Mathematics, 07.12.2020 19:00
question
Physics, 07.12.2020 19:00
question
Mathematics, 07.12.2020 19:00
Questions on the website: 13722361