Homework
Due: 20 Apr
Write a program for a modified exercise 15 on page 526.
The user enters the number of rows and the number of columns. The
grid is rectangular, not necessarily square. The program reports how
many ways there are to go from the start at the lowerleft corner to
every other position (including the finish at the upperright corner)
moving either up or rightwards. Moving down or left or diagonally
isn't allowed. Use a 2D array of integers that records this
information; display it as a 2D grid when the information has been
calculated.
The book has a partial solution that deliberately does not work, but
you'll still have to think about how to do the problem; randomly
changing the code probably won't yield the correct version. You must
use the recursive method. Hint: There are 48620 ways to get to 10,10.
There's about four billion ways to get to 20,17.
You might notice the similarity to combinations.
The Array2DTest.java program contains some 2D array examples.