Which set of statements totals the items in each row of two-dimensional array items, and displays each row’s total?

a.
for (int row = 0; row < items.length; row++) {
int total = 0;

for (int column = 0; column < items[row].length; column++) {
total += items[row][column];

System.out.printf("Row %d's total is %d%n", row, total);
}
b.
int total = 0;

for (int row = 0; row < items.length; row++) {
for (int column = 0; column < items[row].length; column++) {
total += items[row][column];
}

System.out.printf("Row %d's total is %d%n", row, total);
}
c.
int total = 0;

for (int row = 0; row < items.length; row++) {
for (int column = 0; column < items[column].length; column++) {
total += items[row][column];
}

System.out.printf("Row %d's total is %d%n", row, total);
}
d.
for (int row = 0; row < items.length; row++) {
int total = 0;

for (int column = 0; column < items[column].length; column++) {
total += items[row][column];
}

System.out.printf("Row %d's total is %d%n", row, total);
}


a.
for (int row = 0; row < items.length; row++) {
int total = 0;

for (int column = 0; column < items[row].length; column++) {
total += items[row][column];
}

System.out.printf("Row %d's total is %d%n", row, total);
}

Computer Science & Information Technology

You might also like to view...

____ software helps you cut out unwanted frames, add special effects, arrange segments, overlay soundtrack, and designate transitions from one segment to the next.

A. Video B. Video editing C. Video capturing D. Video scanning

Computer Science & Information Technology

Where are object member variables initialized?

A. in the class constructor function. B. in the main function. C. in the destructor function. D. in the private: section of the .h file.

Computer Science & Information Technology

The _______ member function takes a single char value from the input file, without regard to whether it is whitespace.

a) newLine b) get c) put d) getline e) putline

Computer Science & Information Technology

__________ memory allocation is the ability for a program to obtain more memory space at execution time and to release space no longer needed.

a) Static b) Active c) Selective d) Dynamic

Computer Science & Information Technology