CPlusOOP
SiteMap
Building C++ Classes
Programming C++
Function/Variable Scope
«Prev
Function Prototypes
C++ Core
Convert C program C++
Using IO Stream - Exercise
Similarities in C/C++
Program Structure Differences
C++ Boolean Expressions
C++ String Functions
C++ improves casts
Declarations enumerated Types
Initializing enumerated lists
Declaration Scope
Preferred Comment Style
Differences Similarities C/C++
Basic C++ Quiz
Scope of Function
CPlus Function Prototype
default Function Arguments
Overloading Functions
CPlus inline Functions
File Local Scope
CPlus Storage Classes
Initializing external Static Variables
Linking Separate Modules
namspace scope
Anonymous Namespaces
Functions Variables - Conclusion
Functions Scope - Quiz
Pointers Memory Allocation
C++ const keyword
const pointer argument
reference Declarations
Call by Reference
C++ Generic Pointer
void formal Parameter
Free Store Operators
C++ new Operator
C++ delete Operator
Dynamic Array
Dynamic multi-dimensional
array allocation Function
array deallocate Function
findmax Function
C++ main function
memory Allocation Conclusion
Pointers Memory Allocation - Quiz
Course project output routine
Objective:
Write a display routine for the life simulation course project.
Instructions
The life simulation will be played on a 10 by 10 "life board." Each cell of the board will either be empty or "alive."
Create a two-dimensional array for the board. Use this array to store information and to display the board.
Since you have not developed the game yet, you can initialize the board with random X's or 1's to indicate a cell that is alive.
You can easily do this when you display the board by checking
rand()
modulus 2. If this equals 1, then display an X in the cell. If
rand()
modulus 2 equals 0, then do not display an X.
Be sure to use function prototypes in your code.
Run your program several times and make sure the board content is being initialized differently each time.
Paste the source code of your program below and click the
Submit
button when you are ready to submit this exercise.
Submit