![]() |
Learning New OOP Concepts
I've done a fair share of programming over the last couple of years, but I was wondering if anyone had any exercises dealing with Inheritance or Polymorphism to help me learn the concepts. Old Uni assignments anyone?
Barring that, just where I can go to learn this kinda stuff would be cool. |
for your second question, I think you should check this out: http://www.cplusplus.com/doc/tutorial/
apart from that, I think you need a book on C++ to help you with the exercises... There is a free electronic book that will teach you the concepts of C++ polymorphism and Inheritance. It's called Thinking in C++ and it's free. |
Even thou things are done a bit differently, Java is really good for learning OOP concepts. The ideas are the same (almost). There should be plenty of c++ classes tutorials around. I really liked the "wrox press c++ something" ebook. I thaught its really good for beginners. Came with my vc++ 6.0 compiler package.
If you are just looking for a challenge or "assignment", make a html parser. Should be good enough exercize for oo stuff. |
We had to make a farm with different animals, where animals was inherited from the animal class. It was actually quite entertaining.
Basically, you would be able to cycle through the animals. You could choose from three buttons: Speak, Feed, Play Old McDonald. It was kind of like GigaPet, because you had to feed them or else they would die and then when you played the old McDonald song you wouldn't hear them moo/crow/etc. Anyway, I thought that project was pretty fun because my group took some liberties with it. |
i don't remember exactly what the hell this really does or is, but i think it was a simple test program for mult inheritance and polymorphism.
:
#include <iostream> |
Thanks for the code example, right now I don't really understand whats happening, but I do have "C++ From the Beginning" by Jan Skansholm from my first year programming course, which has 3 chapters on this kinda stuff, so I should be able to pick up the theory there. I just need code problems to practice it on.
|
| All times are GMT -5. The time now is 8:05 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC