You will be creating a simple version of Game of Life.. Write a


Added on  2019-09-19

1 Pages340 Words181 Views
You will be creating a simple version of Game of Life.Write a C++ program that tests the function main and the functions discussed in steps1 through 7.1. Declare two global variables:const int MAX_COL = 60;const int MAX_ROW = 30;2. Declare 2 two-dimensional arrays of type int using the size specified in step 1.currentArrayandtempArray3. Write the definition of the functiondisplayMenuthat displays the following menu.[P]lay – Press 'P' to play.[Q]uit – Press 'Q' to exit.4. Write the definition of the functionsetZeroArraythat initializes any two-dimensional array of type int to 0.5. Write the definition of the functionsetInitialPatternArraythat creates the pattern of ‘U’ using ‘1’ inany two-dimensional array of type int. The following shows a portion of an array. Use the predefinedrand()function to determine the row and column of the first1(bold).0000000000100000100100000100100000100100000100100000100111111100000000006. Write the definition of the functioncopyArraythat copy a two-dimensional array to another two-dimensional array.7. Write the definition of the functiondisplayArraythat prints any two-dimensional array of type int.8. When executing your program, the following should happen:a. Print the menu using thedisplayMenufunction.b. Initialize thetempArrayusing thesetZeroArrayfunction.c. Set the ‘U’ pattern in thetempArrayusing thesetInitialPatternArrayfunction.d. Copy thetempArrayto thecurrentArrayusing thecopyArrayfunction.e. Print thecurrentArrayusing thedisplayArrayfunction.f. When the user presses ‘P’, you will repeatathrougheonlyonce.When the user presses ‘Q’, it will terminate the program.Make sure that it compiles using Code::Blocks.

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Technical Programming Answer 2022

Mouse Maze Solver Program using C++ and Visual Studio

Extensions to the Multitasking Kernel

Testing Plan for CTAStations Application

Addressing Knowledge Based Evidence for BSBITU101