Lab 13: Prelab Questions

Write out your answers for these questions on a separate piece of paper.

Written Questions

Question #1: A two-dimensional structure is stored in C++ as a ____________ of ____________s.

Question #2: A two-dimensional structure is thought of in terms of ____________ and ____________.

Question #3: A(n) ____________ allows us to create a new data type in C++ using existing data types.

Question #4: How many neighbors do most cells have in the game of life?

Question #5: When is an organism born in a new generation of the game of life?

Programming Exercises

Code #1: Write a type definition to declare Row as a vector of bools.

Code #2: Write a declaration to declare grid as a vector of Rows

Code #3: Write a declaration to access the first row and second column of grid. (Assume that the grid is large enough for these indices to work.)

Code #4: Write an expression that evaluates to the number of rows in grid.

Code #5: Write expressions that evaluate to the west and east neighbors of grid[r][c].

Lab Home Page | Lab Exercise | Homework Projects
© 2003 by Prentice Hall. All rights reserved.
Report all errors to Jeremy D. Frens.