CS 2401 Quiz #2

Date: Tuesday, February 1, 2011.

1. Which of the following topics are covered in the chapter that you were assigned to read (answer Y/N for each topic):

2. Write a method that, given a 2-D array and a column index, returns the sum of all elements of the given column. Trace how your method will work when we use it to compute the sum of Column 1 in the following array:

 1  2
 3  4
Hints: The result should be 2 + 4 = 6. The method should be applicable to a 2-D array of any size. Do not forget that to make a method work, you must call it; show how you call it.