CS 2401 Quiz #2

Date: Monday, February 1, 2010.

1. Please answer questions about the reading assignment:

1a. can a method call itself?

1b. can a method call another method?

1c. name one of the problems for which the book proposes a solution based on recursion

2. Let rain[i][j] describe the amount of rain (in inches) on day i at location j. Write down a piece of code that computes the total amount of rain at a given location. Trace this code on an example of 2 days and 2 locations, with

in your example, trace how your code will find the total amount of rain at location 0.