?
Solved

c++ programming project

Posted on 1999-11-24
9
Medium Priority
?
326 Views
Last Modified: 2010-04-16
Hello,
I am currently studying C++ and I think I have I good understanding of all C++ concepts. However, no matter what text books I use I cannot find a good programming problem to test my C++ skills. I would like a project that uses several classes and uses inheritance, polymorphism etc.
Can anybody help? I can offer you more points for a good problem.

Thank you, Sean.
If you'd prefer to e-mail your solution : seanm_100@yahoo.com


0
Comment
Question by:Sman
9 Comments
 

Author Comment

by:Sman
ID: 2233351
Edited text of question.
0
 

Expert Comment

by:jaxman
ID: 2233360
I suppose it depends on how ambitious you want to be. :-)

I would suggest writing a maze creation and traversal program.

For example, you might want to set up one class that encapsulates the maze data structure, a base class and several inherited classes that print the maze out either to the screen or a text file format (basically a dump of the data structure you can read back in later to "load" your maze) (this will also let you practice polymorphism, because you should have a virtual method on the base class for print/dump that you can override in the subclasses depending on the type of output), one class that accesses the maze data class to traverse the maze, one that is finished yet another output class in your inheritance tree to output the traversal instructions along with the maze, etc.

As you can see, this is a program which you can keep adding to, is pretty fun to have lying around, and has a lot of potential variables. You can vary the size of the maze, complexity (% of dead ends, loops, etc) as you learn more about how your program works.

Good luck! :-)
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2233464
O there are many programms of Crackers
game, but by meening of "askers", not
exeleent. If you want , you can
fix bugs and get giid programm.
If you interesting, URL's of crackes
i can post here.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2233465
Not Crackers, of course: Checkers!
0
 
LVL 3

Expert Comment

by:LucHoltkamp
ID: 2234350
Checkers is 8x8?
I don't play checkers, but I do play draughts (10x10) and there are several programs (like TRUUS) that play on grandmaster level... I can't beat them, not in a thousend years :-)
Don't underestimate it, its high tech!
0
 
LVL 2

Expert Comment

by:Mindo
ID: 2234407
This is the problem i was doing at my university a month ago:

The program runs as a dialog with a single window. If the user clicks on the window, a rectangle is drawned on that point. This way the user can add as many rectangles to the screen as he wants to. If the user double-clicks the rectangle, it gets selected. The user can select any rectangle on the screen. If there are any rectangles selected already and the user clicks somewhere on the dialog, the selected rectangles are grouped and moved to the new location.

This is a good task to test C++ features. You can have any graphical shape - triangle, rectangle etc. You can use inheritance here. Use polymorphism in the draw() methods of the shapes. Use aggregation of the objects to group them. You can add various member functions to manipulate the shapes. You can add undo/redo mechanism to make your program work like a graphical editor. Test C++ features by changing the appearance of the shapes.

By doing this task i have implemented the Composite/Decorator/Strategy/Command patterns. These are OOP models which are on the hype in contemporary programming.

By the way, i have it done. I can send an *.exe file for ya :-)
0
 
LVL 2

Accepted Solution

by:
DrBeaker earned 100 total points
ID: 2236978
Here's an interesting challenge...

Come up with a set of classes that will allow a file record to by composed dynamically and pocessed either as a whole record or as component fields.

A record might be a sequence of char and / or binary fields, and some fields may be composites of other fields - in effect mini records.

Fields may be fixed length (eg char[20[ or int) or may be some form of variable length (eg a CSV file).

It would be intended that one should be able to read/write/print/compare records and / or fields, and process fields within records.

It should be possible to compose a set of fields into a new record.
0
 
LVL 2

Expert Comment

by:Resonance
ID: 2239173
Warning, the following comment shows heavily my personal social leanings.

You might be going about this the wrong way.  I've found the best way to test my coding skill is to attempt to write something useful to myself or the open source community, release it once it can do something, and refine it until nothing else can be taken away.  If it's even marginally useful, you'll probably even get help.

Note that I steal a portion of a somewhat well known quote above in emphasizing, until nothing can be taken away, rather than until nothing can be added.

The most elegant solution to a problem doesn't always involve every trick in the C++ handbook, and getting into the habit of using inheritance, polymorphism, etc. for every problem might actually not be a good thing.

Also, it seems to me that writing a program just for the sake of throwing code together, especially if it will never be used afterwards, is kind of a waste.  Might as well be working on something that someone -- or you, yourself -- will use.  Isn't there anything you wanted to do with your computer that you can't currently do?  If nothing comes to mind, you can even get paid for some projects.  I suggest you look into the Free Software Bazaar at:

http://visar.csustan.edu/bazaar/bazaar.html

There are many requested projects there, with some small (and some not-so-small) donations attached to them.
0
 
LVL 2

Expert Comment

by:mflam
ID: 2251385
A C++ Tutorial Project as your project.

How about making a tutorial object that teaches the concepts of C++!

You would have boxes with "private" sections and "public" sections.
You could pull lines from one to the other, inside and outside the object, and it will allow you or turn red.

You cannot pull a line from a virtual function, but when you highlight a function it's ancestors, including the virtual highligh up...

Etc. etc.  You decide what exactly you want to do!

By pressing a button you could "show" all the polymorphs, and why this one was chosen.

You could show how the compiler decides which function on which object to create automatically during construction etc.

Moshe
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question