Which set of statements totals the items in each row of two-dimensional array items,and displays each total?
A) int total = 0;
For ( int row = 0;row < items.length;row++ )
{
Total = 0;
For ( int column = 0;column < a[ row ].length;column++ )
Total += a[ row ][ column ];
System.out.printf( "%d\n",total ) ;
}
B) int total = 0;
For ( int row = 0;row < items.length;row++ )
{
For ( int column = 0;column < a[ row ].length;column++ )
Total += a[ row ][ column ];
System.out.printf( "%d\n",total ) ;
}
C) int total = 0;
For ( int row = 0;row < items.length;row++ )
{
For ( int column = 0;column < a[ column ].length;column++ )
Total += a[ row ][ column ];
System.out.printf( "%d\n",total ) ;
}
D) int total = 0;
For ( int row = 0;row < items.length;row++ )
{
Total = 0;
For ( int column = 0;column < a[ column ].length;column++ )
Total += a[ row ][ column ];
System.out.printf( "%d\n",total ) ;
}
Correct Answer:
Verified
Q23: What kind of application tests a class
Q25: Which command below runs TestProgram,and passes in
Q26: Class Arrays provides method _ for comparing
Q27: In Java,multidimensional arrays _.
A)are not directly supported.
B)are
Q28: An argument type followed by a(n) in
Q33: An array with m rows and n
Q38: Which of the following statements creates a
Q41: Which method call converts the value in
Q43: Class Arrays methods sort, binarySearch, equals and
Q45: Which of the following is false?
A) The
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents