Suppose that sales is a two-dimensional array of 10 rows and 7 columns wherein each component is of the type int. Which of the following correctly finds the sum of the elements of the fifth row of sales?
A. int sum = 0;
for(int j = 0; j < 7; j++)
sum = sum + sales[5][j];
B. int sum = 0;
for(int j = 0; j < 7; j++)
sum = sum + sales[4][j];
C. int sum = 0;
for(int j = 0; j < 10; j++)
sum = sum + sales[5][j];
D. int sum = 0;
for(int j = 0; j < 10; j++)
sum = sum + sales[4][j];
Answer: B
You might also like to view...
Match the following features of a dialog box to each of their purposes:
I. option button A. mutually exclusive choices II. check box B. enables the user to enter specific information III. list box C. quick method of increasing/decreasing a setting IV. spin arrow D. used if choices are not mutually exclusive V. text box E. displays all or some of the available choices
The Merge & Center button is located in the ________ tab
A) Alignment group on the Layout B) Styles group on the Home C) Styles group on the Layout D) Alignment group on the Home