Create a simulator of chasing animals Requirements 1 Create

Create a simulator of chasing animals Requirements (1) Create a function that displays a two dimensional array. The example uses a 35 X 35 array. If the stored valuc is 0, show\"\", otherwise show the stored number. Hint: Use two dimensional array, nested loops, and if statement (2) In the main program, set the randomly selected starting locations for each number /animal. The example uses number 1 through number 6 (3) Move each number/animal so that an animal chases the next animal. For example, animal # 1 chases animal # 2, animal # 2 chases animal # 3, and animal # 6 (the last animal) chases animal # 1 (the first animal). Hint: Use modulus division, as well as if statements. You may choose the direction of the movement to either four directions or eight directions. (4) Repeat Number 3 at least 20 times. Show the trace of each animal\'s numbers. Hint: Use a loop. You may use system( CLS\") to clear the screen, and system(\"pause\") to pause after each iteration Pleasc Submit 4 points) 2. Printout of your C++program with a heading comment (Do not forget to (4 points) (2 points) 1. A flowchart of your program add comments within your program) 3. Copy of a screenshot after your program is executed.

Solution

It will print it on console. You can take the screenshot of each moment.

Regarding the file, you can use fstream. just write the output to file by creating file every time. If you need hint regarding that you can ask me.

Anyway I have just changed the code you can check it out.

It will write into files with names out1, out2 etc. You can change i to 20 to get 20 files.

 Create a simulator of chasing animals Requirements (1) Create a function that displays a two dimensional array. The example uses a 35 X 35 array. If the stored

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site