By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,569 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,569 IT Pros & Developers. It's quick & easy.

need help with MBA course project

P: n/a
My apologies to those of you who are more advanced Visual C++ .NET
programmers, but I am working on a project for an MBA course that is
condensed into an eight-week schedule, and I need help getting a
program up and running with proper files and documentation to be handed
in for a grade (on Microsoft Visual Studio .NET 2003).

I am being graded on how well I incorporate advanced C++ features such
as inheritance, polymorphic programming, exception-handling, components
of the Standard Library, etc. as well as whether the program runs and
compiles correctly and is properly documented. Being relatively new to
both C++ and Visual Studio .NET, I am not sure what my header files,
source files, and resource files will look like. I have followed the
basic examples in the online tutorials that Microsoft offers, but I
want to make sure I'm getting the details right for a program more
complex than a "Hello World" program.

What I am trying to develop is a very simplified simulation of Conway's
biological game of life. Keep in mind that this is for an MBA course
and not for an advanced science course. The rules of the game I'd like
to incorporate into the program are, for a cluster of cells:
1. Any cell with fewer than two neighbors dies.
2. Any cell with more than three neighbors dies.
3. Any cell with two or three neighbors lives.

I am thinking that I would like the program to be a variation on a card
shuffling and dealing simulation--an array of data structures--that
appears on p. 1062 of Harvey Deitel's textbook, C++: How to Program
(Fifth Edition) (unless anyone can think of a better model). Instead of
using the class "DeckofCards" as my array of data structures, I will
use the class "ClusterOfCells". My objects will be the individual
cells.

I would like to use polymorphic programming in the sense that each
cell's identity will change (it will be a dead cell or live cell) based
on the inputs or functions that act on it. I am debating whether some
basic selection/repetition statements are the best way the develop the
basic logic of the game, or if there is some way to incorporate virtual
functions with dynamic binding into the program, so that each cell is
exhibiting the behavior of surviving or dying based on conditions in
the cell's environment. Regardless of whether my functions are virtual
or static, I will need them to act on a cell so that they communicate
to a cell how many neighbors it has and then cause the cell to live or
die based on the number of neighbors.

Finally, I would like to incorporate the "remove" and "replace"
algorithms from the Standard Library so that a dead cell is removed
from the cluster of cells and is replaced by a live cell. And again, I
need to incorporate exception handling, document everything properly,
and make sure everything compiles and runs correctly.

Any help would be greatly appeciated, as I am under a tight deadline!

Jun 16 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ro*******@gmail.com wrote:
[...]
What I am trying to develop is a very simplified simulation of
Conway's biological game of life. Keep in mind that this is for an
MBA course and not for an advanced science course. The rules of the
game I'd like to incorporate into the program are, for a cluster of
cells:
1. Any cell with fewer than two neighbors dies.
2. Any cell with more than three neighbors dies.
3. Any cell with two or three neighbors lives.

[...]

Any help would be greatly appeciated, as I am under a tight deadline!


Here is my contribution: your rules are missing the one that governs
the creation of new life in an empty cell.

Beyond that, I am not sure what kind of help you expect. You describe
relatively well what *you* need to do.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jun 16 '06 #2

P: n/a
* ro*******@gmail.com:
I would like to use polymorphic programming in the sense that each
cell's identity will change (it will be a dead cell or live cell) based
on the inputs or functions that act on it. I am debating whether some
basic selection/repetition statements are the best way the develop the
basic logic of the game, or if there is some way to incorporate virtual
functions with dynamic binding into the program, so that each cell is
exhibiting the behavior of surviving or dying based on conditions in
the cell's environment. Regardless of whether my functions are virtual
or static, I will need them to act on a cell so that they communicate
to a cell how many neighbors it has and then cause the cell to live or
die based on the number of neighbors.


It's not a good idea to abstract up low level things. It's not a good
idea to start abstracting at all, before you have enough of a grip on
the problem to be able to do it without any fancy stuff. It's not a
good idea to decide in advance what tools you'll bring to bear on a
problem you don't yet understand.

Since you're off on entirely the wrong foot, the only advice I can offer
is to not think in terms of /a/ program: you need to first create a
smallest possible text only program that does this thing with no more
abstraction than absolutely necessary, just to understand what you're
trying to do. The program should work. And you should understand why.

Then work iteratively, creating a second program, and a third.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jun 16 '06 #3

P: n/a
ro*******@gmail.com wrote:
I am being graded on how well I incorporate advanced C++ features such
as inheritance, polymorphic programming, exception-handling, components
of the Standard Library, etc. as well as whether the program runs and
compiles correctly and is properly documented.

What I am trying to develop is a very simplified simulation of Conway's
biological game of life. Keep in mind that this is for an MBA course
and not for an advanced science course. The rules of the game I'd like
to incorporate into the program are, for a cluster of cells:
1. Any cell with fewer than two neighbors dies.
2. Any cell with more than three neighbors dies.
3. Any cell with two or three neighbors lives.


It is supposed to be:

3. Any cell with two neighbors does not change state.
4. Any cell with three neighbors lives.

Having implemented Conway's life quite recently I would say using advanced
C++ features on it is a bit of a stretch. I certainly did not use
polymorphism in any way. STL wise std::vector and std::fill was pretty much
it.

The one thing that can be a bit of a challenge is performance and that does
not seem to be relevant for your grade.

My advice would be to look for a different problem if you have a choice.

Jun 16 '06 #4

P: n/a
"Alf P. Steinbach" wrote:
I would like to use polymorphic programming in the sense that each
cell's identity will change (it will be a dead cell or live cell) based
on the inputs or functions that act on it. I am debating whether some
basic selection/repetition statements are the best way the develop the
basic logic of the game, or if there is some way to incorporate virtual
functions with dynamic binding into the program, so that each cell is
exhibiting the behavior of surviving or dying based on conditions in
the cell's environment. Regardless of whether my functions are virtual
or static, I will need them to act on a cell so that they communicate
to a cell how many neighbors it has and then cause the cell to live or
die based on the number of neighbors.


It's not a good idea to abstract up low level things. It's not a good
idea to start abstracting at all, before you have enough of a grip on the
problem to be able to do it without any fancy stuff. It's not a good idea
to decide in advance what tools you'll bring to bear on a problem you
don't yet understand.

Since you're off on entirely the wrong foot, the only advice I can offer
is to not think in terms of /a/ program: you need to first create a
smallest possible text only program that does this thing with no more
abstraction than absolutely necessary, just to understand what you're
trying to do. The program should work. And you should understand why.

Then work iteratively, creating a second program, and a third.


I set this aside earlier in the week and have finally read the OPs post. I
would loudly say AMEN to what is said here. Instead of attacking the
problem, you have gotten fascinated with a bunch of fancy-shamcy buzzwords.
You said it was for an MBA for God's sake! There are probably a
mini-bazillion Game of Life programs that work perfectly well and were
written by guys who knew zilch about virtual functions and dynamic binding.
Jun 18 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.