CS 630 - Computing Fundamentals I - Fall 2005
Homework 10


Loyola College > Department of Computer Science > CS 630 > Homework > Homework 10

Due

Monday, November 28th at the beginning of class

Problems

Exercise (p. 605)
11.1, 11.2, 11.7, 11.9

1) Write a code segment that does the following:

  1. Defines constants MAX_ROWS equal 25 and MAX_COLUMS equal to 10
  2. Defines a two-dimensional boolean array data with 25 rows, where each row consists of 10 elements.
  3. Initializes array data so that elements whose row subscript values are odd have the value true and initializes the other elements to false

2) Assume that you are creating a class Crossword which stores a crossword puzzle as a two dimensional array of characters. The Crossword class has the data field:
private char[][] puzzle;
which is allocated in the constructor and assigned letters. You will write two methods for this class.

Hint: Beware of the edge of the puzzle. You don't want to try to compare letters that are not present.

Programming Project


11.9