Discuss about the multidimensional arrays

Assignment Help Computer Engineering
Reference no: EM132153455

I am having trouble setting up this C++ program. He wants us to use in and out stream to get out blinker and beacon. Below is the only provided instructions on the project.

"Overview: We need to start with the types of C++ tasks that should be included in the final project. We have true multidimensional arrays to work with now.

We will be talking about class objects in the coming days. We've also been doing file IO for several weeks and have had a lab #8 using it. So we end up with Conway's "Life" which can encompass all of these C++ tasks in one, hopefully, rewarding end of semester project.

The book does a very good job of describing the logic and implementation of the game. LIFE is so well known that a vast array of resources pertaining to it can be found on the internet.

Tasks: Since the project is in chapter 7, the book's version doesn't work with classes and it doesn't have any file IO. Let's address the file IO first. On the project download page in addition to the usual items there will be two data files containing very simple life community specifications.

The files have the following format: first item in the file is the number of rows the community requires, second item in the file is the number of columns the community requires, third item is the LIFE community which is stored as ‘.' (dead) or ‘O' (alive) characters in the array shape specified by the preceding two values. Here is an example of a configuration know as a still life block which can be found on the Wikipedia page:

4

4

....

.OO.

.OO.

....

In order for your project to work with these inputs you will need to specify a two dimensional array. The book specifies a 22 by 80 array. The GTA project uses a 50 by 100 (row by col) array. So long as your array is larger than the size specified by the input, your code will work with the input.

After creating the array, the code reads in the data from the input and fills out your LIFE community array with a small twist. The book suggests filling in the grid directly with asterisks for live cells and blanks for dead cells. We will use class objects instead.

The normal implementation of LIFE uses two identical arrays. One stores the now generation and one is used to store the next generation. (see the book pgs 446 & 447) We will be using one array which contains LIFE cell objects made from the simplest useful class we could think of. Our class objects will contain two Boolean data items that store the cell's life condition and one function which will age the cell.

Anti-Chaos:

Your LIFE community's size should be square and an edge length is define globally as const int edge=#. Your class is named cell and contains the public boolean variables aod_d0, aod_d1 and the void function age(). Create a general function that counts the number of living neighbors of a cell and declare its type with the following declaration: int nbors_sum(cell[edge][edge], int, int, int, int);. Your LIFE community ages a day at a time so create a general function that reads cells at d0 and determines whether that cell is alive or dead (aod) at d1.

It's declaration is: void oneday(cell[edge] [edge], int, int);. The oneday function will call the nbors_sum function. The GTA version has a fair amount of code in main() including file input and the while(true) display loop.

No credit challenge extras:

If you'd like to take full advantage of your computer's capabilities, then attempt to place the initial LIFE community at the center of the community array rather than at the upper left corner.

There is a bit of additional math associated with doing this and perhaps the addition of a number of extra variables. If you can get the modification working there are additional LIFE community seeds available from your GTAs and the internet.

Deliverables:

A project report in PDF format.

Reference no: EM132153455

Questions Cloud

Experiences or practicum observations : In your experiences or practicum observations, what classroom setups did you find most useful? How do you see implementing these components in your classroom?
What if the size of the usb flash drive is increased : You also have an LTE data card that connects to your portable computer and receives data any where you're located at a rate of 50 Mbps.
Regarding the effects of a soda tax on other people : Setting self-interest to one side, what is your opinion regarding the effects of a soda tax on other people?
Why twitter is a unidirectional network and facebook is not : The tributaries of the Mississippi River follow a Power Law. Can you explain which variables should go on each axis?
Discuss about the multidimensional arrays : We need to start with the types of C++ tasks that should be included in the final project. We have true multidimensional arrays to work with now.
Create a pointer structure that has members : Create a pointer structure that has members for the x and y coordinates. Use typedef to make a point_t data type.
Why cache memory is faster than main memory : List four types of memory (storage) in the computer memory hierarchy. What is locality principle?
Calculate the opportunity cost : Calculate the opportunity cost and show the answer and the calculation. Should the company ask Bill to make the extra clutches or not?
Relationship between the current accounts of the two : What relationship between the current accounts of the two countries is satisfied when the world real interest rate is at its equilibrium value?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd